We should think about the behavior of mw.widgets.CategorySelector when invalid title is entered a bit. Currently, if you type e.g. "A|B", pressing Enter does nothing and moving keyboard focus away from the field makes the text disappear. Not very user-friendly.
We shouldn't let the text just stay there though, since it is not really "accepted" until it turns into a capsule. Allowing the text to remain, with no other changes, would be even worse (it would lose the user input just the same, but at a later stage when the user can't fix it).
Discussed here: https://commons.wikimedia.org/wiki/Commons:Village_pump/Archive/2016/09#Category_changes_in_Wizard...
Thoughts:
- Just accept the input, and make the code that uses CategorySelector deal with the invalid value?
- Display a text warning when typing?
- Mark the field as 'invalid', but don't remove the entered text?
(Tagging with Multimedia, since our upload tools are the primary place where this is used right now.)