MD Settings: Action menus |
|||||||
Issue descriptionOverflow menus used for list items MD Settings tend to have the following bug: 1. Open two Settings pages side by side. 2. Open the overflow menu for the same list item in both windows. 3. In one window, perform an action from the menu (e.g. Remove) Expected: The menu closes on both pages. Actual: The menu stays open on the other page, so it's now a "dangling" menu. If there is a different list item at that spot now, the menu *may* refer to that item. Examples: Manage search engines, On startup, Languages, ... MD History does not have this issue.
,
Oct 20 2016
I think the easiest solution to implement is to add a Window 'blur' listener, and simply close the menu when it loses focus. This way the user will not be able to have to action menus open on two different windows at the same time. Seems reasonable since it does not actually remove any functionality, while fixing a corner case. Thoughts?
,
Oct 20 2016
,
Oct 25 2016
dpapad@: can we figure out a way to hide an associated action menu if the anchor element is removed? would that fix our issues here?
,
Oct 25 2016
First, let me clarify that this bug applies only to cases where we have 1 shared action menu for N items. For the 1-1 case, the action menu itself is a child of the item, so when the item is removed, the action menu is also removed. So for the 1-N case, yes, if we somehow could get notified that the anchor element got removed, and close the menu, it would fix the issue. Michael mentioned at comment#1 that MD history does not have this issue. I am wondering how do they handle this, given that AFAIK they are using cr-shared-menu, which falls under the 1-N case.
,
Oct 25 2016
dpapad@: history probably works cuz this https://cs.chromium.org/chromium/src/chrome/browser/resources/md_history/list_container.js?q=md_history+closeMenu_&sq=package:chromium&l=42&dr=C
,
Oct 25 2016
though I don't think it'd be hard to do something like:
onDotsTap_: function() {
this.actionMenu_ = ... create action menu ...
},
detached: function() {
if (this.actionMenu_)
this.actionMenu_.close();
},
,
Oct 25 2016
Well, it would have to be more sophisticated than this. If the menu has been assigned to a different list item already, detached() should do nothing. Otherwise the menu might be accidentally closed when an unrelated item is removed.
,
Oct 26 2016
I'm also happy to hide on blur. It appears that native dropdowns work that way.
,
May 5 2017
hiding on window blur seems reasonable and easy -- cr-action-menu already closes on window resize. It doesn't address the case where an item is removed without user action, like if syncing settings happens to remove a search engine or something like that. But I doubt that's likely to happen.
,
Oct 24 2017
Marking bugs (mostly lower priority ones) that I am unlikely to get to soon as Available.
,
Oct 25
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 7
I am closing this bug. It refers to a corner case that has not come up otherwise, and therefore it's not clear it is worth spending time on it. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by dpa...@chromium.org
, Oct 20 2016