inveniosoftware / react-invenio-deposit

React application for Invenio deposit forms.
https://react-invenio-deposit.readthedocs.io
MIT License
3 stars 46 forks source link

Nested languages: value automatically selected after search #365

Closed jrcastro2 closed 3 years ago

jrcastro2 commented 3 years ago

Package version (if known): v0.15.12

Describe the bug

When adding an additional title, if we search for a language but we do not select any option it will automatically select one and will save it, the language field in the UI is broken and if we reload it will show the value even though we didn't select any.

Same applies for language field in additional description.

Steps to Reproduce

  1. Go to 'uploads'
  2. Click on 'New upload'
  3. Click on 'Add titles'
  4. Fill the required fields and write some letters (spa) in the language field
  5. Do not select a language and click 'Save draft'
  6. Language field is bugged and if we reload the field is loaded with a value.

Same error happens in additional description

Expected behavior

If a language is not selected we should not have any value there, it should be empty.

Screenshots (if applicable)

https://user-images.githubusercontent.com/15194802/126781015-d48728eb-d5be-4064-9b33-90df817dcd3d.mp4

Additional context