Page MenuHomePhabricator

MenuTagMultiselectWidget menu doesn't close properly when used with an overlay
Closed, ResolvedPublic

Description

When using a MenuTagMultiselectWidget with an overlay, the menu does not close when clicking outside of the widget but inside of the overlay.

The menu also does not disappear if something causes the widget to be hidden or removed.

Event Timeline

Hmm, I'll need to see the code for this, but my initial suspicion is that this has to do with $autoCloseIgnore and its definition.

Do you have anything on gerrit or on the codebase for me to refer to? Or even a quick sample that I can test?

Ha, I tried to post an example but I put it on the wrong bug.

These can be observed using ApiSandbox with https://gerrit.wikimedia.org/r/399427

Clicking within the overlay does not make it disappear

  • Open Special:ApiSandbox#action=query
  • On the "action=query" tab, click in the "prop" field.
  • Click elsewhere within the form. Note the menu does not disappear. You can get it to disappear by clicking in the sidebar, page header, and so on.

Hiding or removing the widget by interacting with other widgets does not make it disappear

  • Open Special:ApiSandbox#action=query
  • On the "action=query" tab, click in the "prop" field.
  • Go to the "main" tab. Note the menu does not disappear.
  • Select a different value in the "action" field. Note the menu does not disappear even though the "action=query" tab is no longer present.

Hiding or removing the widget due to external actions does not make it disappear

  • Open Special:ApiSandbox#action=query
  • On the "query" tab, click in the "prop" field.
  • Adjust the fragment in the URL to supply a different action, e.g. #action=parse. Note the "action=query" tab disappears, but the menu remains.

OK, as I suspected, this was $autoCloseIgnore. The widget adds the $overlay to the autoCloseIgnore, which is wrong -- it means that the menu won't close when you click the overlay, that's basically everywhere.

I submitted a fix to OOUI. Thanks for catching this.

Change 399882 had a related patch set uploaded (by Catrope; owner: Mooeypoo):
[oojs/ui@master] MenuTagMultiselectWidget: Don't use overlay for $autoCloseIgnore

https://gerrit.wikimedia.org/r/399882

Change 399882 merged by jenkins-bot:
[oojs/ui@master] MenuTagMultiselectWidget: Don't use overlay for $autoCloseIgnore

https://gerrit.wikimedia.org/r/399882