Commit 2e6ccb30 authored by Isabella Scalzi's avatar Isabella Scalzi Committed by Commit Bot

Stop propagation of |get-info| command when caught

Currently when the |get-info| command is caught by an element, the event
continues to propagate, which causes |display_| to be called twice in
some cases.

Fix this: stop propagation of the event when handled.  No change in
behavior, no new tests.

Bug: 1044448
Change-Id: I670bb872b414f18265cb68688d704ab4c0088976
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2026532Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736263}
parent 3bb31f09
...@@ -86,16 +86,19 @@ class QuickViewController { ...@@ -86,16 +86,19 @@ class QuickViewController {
// Selection menu command can be triggered with focus outside of file list // Selection menu command can be triggered with focus outside of file list
// or button e.g.: from the directory tree. // or button e.g.: from the directory tree.
if (event.command.id === 'get-info') { if (event.command.id === 'get-info') {
event.stopPropagation();
this.display_(QuickViewUma.WayToOpen.SELECTION_MENU); this.display_(QuickViewUma.WayToOpen.SELECTION_MENU);
} }
}); });
this.listContainer_.element.addEventListener('command', event => { this.listContainer_.element.addEventListener('command', event => {
if (event.command.id === 'get-info') { if (event.command.id === 'get-info') {
event.stopPropagation();
this.display_(QuickViewUma.WayToOpen.CONTEXT_MENU); this.display_(QuickViewUma.WayToOpen.CONTEXT_MENU);
} }
}); });
selectionMenuButton.addEventListener('command', event => { selectionMenuButton.addEventListener('command', event => {
if (event.command.id === 'get-info') { if (event.command.id === 'get-info') {
event.stopPropagation();
this.display_(QuickViewUma.WayToOpen.SELECTION_MENU); this.display_(QuickViewUma.WayToOpen.SELECTION_MENU);
} }
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment