When focus is removed from a CapsuleMultiSelectWidget and the text input field is empty, it will attempt to commit the text. The end result is that the text either becomes a valid entry in the widget or it disappears.
When focus is removed from TagMultiSelectWidget, it leaves the uncommitted text in place. It is very easy[1] to think that this text is part of the value of the widget, when in fact it is not.
[1]: As in I kept having issues with ApiSandbox not seeming to recognize titles entered into the "titles" field, and finally realized it was a regression due to the change in widgets.
To reproduce:
- Open https://en.wikipedia.org/wiki/Special:ApiSandbox
- Select "purge" in the "action" dropdown.
- Select the "action=purge" tab on the left.
- Activate the "titles" widget.
- Type "Foo" into the widget. Do not press enter.
- Remove focus from the widget, by clicking elsewhere or tabbing. Observe that "Foo" is displayed in the widget, as if it were part of the value of the widget.
- Click "Make request"
The sandbox output will be
{
"batchcomplete": "",
"purge": []
}The expected output is
{
"batchcomplete": "",
"purge": [
{
"ns": 0,
"title": "Foo",
"purged": ""
}
]
}The expected output can be achieved by re-focusing the widget and pressing enter. While this does display in the widget as a different state from the erroneous state, the erroneous state is still unnecessarily confusing.