Page MenuHomePhabricator

Keep namespace selection dropdown open after selection
Closed, ResolvedPublic2 Estimated Story Points

Description

Motivation
Most of the time, people who add namespaces for their search seem to add more than one namespace. Currently, the namespace selection dropdown closes after each selection, which makes it cumbersome to select several.

Wanted Solution

  • When a namespace has been selected from the dropdown, leave it open
  • Close the dropdown as defined in OOUI

Task
Realize the wanted solution as suggested by @Mooeypoo in the comments

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Lea_WMDE triaged this task as Medium priority.Dec 14 2017, 11:41 AM
Lea_WMDE updated the task description. (Show Details)

There doesn't appear to be a clean and simple way to do this: https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui.MenuTagMultiselectWidget
One potential work around could be to set up an event where when an item is added we override the toggling of the menu.

Pinging @Mooeypoo as original author of the TagMultiselectWidget group…

The MenuSelectWidget has a 'hideOnChoose' option, conveniently :)
In RCFilters, we're setting it to 'false' in the menu configuration: https://github.com/wikimedia/mediawiki/blob/master/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js#L45

As for closing when losing focus, it should already happen, and if it doesn't, I think it might have to do with setting up $autoCloseIgnore for the menu as a FloatableElement. Is this helping? I can look for the exact definition if it will be more helpful. It should, however, happen automatically for the TagMultiselectWidget -- if it doesn't, I think it might be a bug.

Lea_WMDE set the point value for this task to 2.

Note, by the way, that there is another separate (but perhaps related) configuration option that was added recently to MenuTagMultiselectWidget to prevent clearing the input itself on choose (see https://gerrit.wikimedia.org/r/#/c/401422/ )

RCFilters will have to adjust to that (because we want to keep the filtering active while people choose multiple filters) but I'm not sure if that is relevant to your use case. Either way, this is a new config with a new default behavior (the filtering will be erased by default when an item is chosen now) so I wanted to make sure you're aware of it.

Edit note -- also beware that "hideOnChoose" is a config for the menu and the new "clearInputOnChoose" is a config for the MenuTagMultiselectWidget. Slightly confusing, but hopefully helpful :)

Change 409938 had a related patch set uploaded (by Gabriel Birke; owner: Gabriel Birke):
[mediawiki/extensions/AdvancedSearch@master] Make namespacemlist stay open after selection

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

gabriel-wmde removed gabriel-wmde as the assignee of this task.
gabriel-wmde moved this task from Doing to Review on the WMDE-Fundraising-Sprint-16 board.
gabriel-wmde subscribed.

Some observation: The indicator of the namespace selection can't be used to close the menu, only to open it. I've created T187099: MenuTagMultiselectWidget: Add ways to close the dropdown menu via the entire field and indicator to see what the OOUI team has to say about that, because the name "indicator" for me hints that at least from a purely conceptual standpoint it should be an element for showing state, not manipulating state.

Change 409938 merged by jenkins-bot:
[mediawiki/extensions/AdvancedSearch@master] Make namespace list stay open after selection

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