Page MenuHomePhabricator

MenuTagMultiselectWidget does not clear the input field when selecting a tag from the menu
Closed, ResolvedPublic

Description

When I type a partial tag name in MenuTagMultiselectWidget and then select an item from the corresponding menu, either by directly clicking or by using arrow key navigation and enter, I expect that the text I typed will be replaced with the selected tag. Instead, the tag is inserted but the text remains.

This is a behavior change from CapsuleMultiselectWidget.

Event Timeline

Anomie created this task.Dec 20 2017, 3:48 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 20 2017, 3:48 PM
This comment was removed by Anomie.

Hm, in RCFilters, we do it manually through extending onTagSelect we have this.input.setValue( '' );

We need to upstream this, it's a bit of an oversight on my part for not including it, especially if the menu is filtering from the input. I'll submit a patch -- but if you want to not wait for the OOUI release, I'd just extend the onTagSelect and nullify the input manually for the moment as a hack.

Change 399539 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[oojs/ui@master] MenuTagMultiselectWidget: Erase the input when tag is selected if filtering

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

Change 399539 merged by jenkins-bot:
[oojs/ui@master] MenuTagMultiselectWidget: Erase the input when tag is selected if filtering

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

Prtksxna assigned this task to Mooeypoo.Jan 2 2018, 2:03 AM
Prtksxna removed a project: Patch-For-Review.

I thought what @Anomie meant was that the input should be cleared when a tag is selected from the menu (onMenuChoose). Is that correct?

CurrentDesired (like CapsuleMultiselectWidget

Change 401422 had a related patch set uploaded (by Prtksxna; owner: Prtksxna):
[oojs/ui@master] MenuTagMultiselectWidget: Erase the input when a menu option is chosen

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

Anomie added a comment.Jan 2 2018, 5:03 PM

I thought what @Anomie meant was that the input should be cleared when a tag is selected from the menu (onMenuChoose). Is that correct?

CurrentDesired (like CapsuleMultiselectWidget

Yes, those images correctly reflect the bug and desired behavior.

I see, I misunderstood. I am a bit weary of doing this so broadly (we're going tohave to override this in RCFilters, because we don't close the popup on every choice and would like to keep the filtering)

Maybe we should instead clear the input on menu-close?

Volker_E added a subscriber: Volker_E.EditedJan 2 2018, 8:49 PM

From a UX perspective I'm leaning towards @Anomie's request. Having to delete the input manually after actively choosing one of the autocomplete options in order to add next tag seems odd.
So RCFilters as special case.

I see, I misunderstood. I am a bit weary of doing this so broadly (we're going to have to override this in RCFilters, because we don't close the popup on every choice and would like to keep the filtering)

Thanks for explaining @Mooeypoo. If I understand correctly, the popup not closing happens through the hideOnChoose in FilterTagMultiselectWidget. Clearing the input is a separate thing, right? Also, doesn't FilterTagMultiselectWidget already override onMenuChoose? If so, such a change would be ok?

Maybe we should instead clear the input on menu-close?

This is an interesting idea, I'd like to clarify some things though. If we do this, then the default MenuTagMultiselectWidget would always clear the input since it doesn't set hideOnChoose by default. But, if someone does set it, like in the case of FilterTagMultiselectWidget, the input doesn't get cleared?

I'd still prefer to always clear and let FilterTagMultiselectWidget override this like it is already doing.

Volker_E moved this task from Backlog to Doing on the OOUI board.Jan 6 2018, 7:31 AM

Change 401422 merged by jenkins-bot:
[oojs/ui@master] MenuTagMultiselectWidget: Erase the input when a menu option is chosen

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

Volker_E triaged this task as Normal priority.Feb 6 2018, 10:25 PM
Volker_E moved this task from Doing to OOUI-0.25.2 on the OOUI board.
Volker_E edited projects, added OOUI (OOUI-0.25.2); removed OOUI.
Volker_E removed a project: Patch-For-Review.

@Mooeypoo Heads-up, this will go into OOUI v0.25.2.

Volker_E closed this task as Resolved.Feb 6 2018, 10:27 PM
Volker_E reassigned this task from Mooeypoo to Prtksxna.

Awesome, thank you! RCFilters already overrides the onMenuChoose behavior (we deal with filtering in the model layer) but this is important to note. Thanks for this!