Steps to reproduce
- Edit an existing ZObject, E.g. https://wikifunctions.beta.wmflabs.org/w/index.php?title=Z10024&action=edit&view=zobject-editor
- It already has a Spanish (Z1003) label
- In the Label block, on the "Select language" lookup field to add a new label, start writing "Spanish"
- GOOD: No option is offered to add "Spanish", as it's already present
Observed behavior
- Directly type Z1003 into the Lookup field
- Select Z1003 (Spanish)
- The existing value for Spanish is removed
- Write a label
- The string is written in both fields
- Observe the JSON representation: one Spanish label is there with the new string and another with the old string
Expected behavior
- No Z1003 Spanish value can be entered
- When the value is selected (with the mouse, or pressing enter or tab) we should check whether the value is duplicated
Additional information
- Here's the demo for this behavior: https://www.loom.com/share/579f783f53ec429f9c05a881eb4d494f
- There are other places where language tags should not be repeated:
- Label box in zobject editor
- ZMultilingualString component in zobject editor
- Argument list in function editor