Page MenuHomePhabricator

MenuTagMultiselectWidget with items and allowArbitrary: ENTER adds the wrong item
Closed, ResolvedPublic

Description

Consider the following:

new OO.ui.MenuTagMultiselectWidget( {
	allowArbitrary: true,
	options: [
		{
			data: 'foo',
			label: 'Label for foo',
		},
		{
			data: 'bar',
			label: 'Label for bar'
		}
	]
} )
  1. Click in the textinput
  2. The menu is shown
  3. type 'a'
  4. The menu is hidden because no items match 'a'
  5. type <enter>
  6. Expected: A tag 'a' is added (because allowArbitrary)
  7. Actual: A tag 'Label for foo' is added

Note: using menu: { highlightOnFilter: true } in the config fixes it but causes T209716

Note 2: Happens as described above only the first time after creating the control.

Event Timeline

Change 475034 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[oojs/ui@master] MenuTagMultiselectWidget: Allow adding arbitrary values

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

Volker_E edited projects, added OOUI (OOUI-0.29.6); removed OOUI.

Change 475034 merged by jenkins-bot:
[oojs/ui@master] MenuTagMultiselectWidget: Allow adding arbitrary values

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

Volker_E assigned this task to Mooeypoo.
Volker_E triaged this task as Medium priority.
Volker_E removed a project: Patch-For-Review.

This landed in OOUI 0.29.6, and thus MediaWiki 1.33.0-wmf.8.