Keep namespace selection dropdown open after selection
Closed, ResolvedPublic2 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

Restricted Application added a project: TCB-Team. · View Herald TranscriptNov 30 2017, 12:25 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Lea_WMDE moved this task from Proposed to Todo on the WMDE-QWERTY-Team board.
Lea_WMDE moved this task from Todo to Sprint ready on the WMDE-QWERTY-Team board.Dec 11 2017, 11:40 AM
Lea_WMDE triaged this task as Normal 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.

Should probably be done in OOjs UI @Volker_E

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 updated the task description. (Show Details)Feb 7 2018, 12:53 PM
Lea_WMDE set the point value for this task to 2.
Lea_WMDE updated the task description. (Show Details)Feb 7 2018, 12:56 PM
Lea_WMDE moved this task from Tickets ready for pickup to In FUN sprint on the Advanced-Search board.
Mooeypoo added a comment.EditedFeb 7 2018, 10:48 PM

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 removed gabriel-wmde as the assignee of this task.
gabriel-wmde added a subscriber: gabriel-wmde.

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

Tonina_Zhelyazkova_WMDE closed this task as Resolved.Feb 14 2018, 2:29 PM
Tonina_Zhelyazkova_WMDE claimed this task.