To reproduce:
- Start adding a sense
- Enter a valid language code in the language field
- Tab to the gloss field and enter some text
- Tab back to the language field
- Change the language code and immediately press enter
- It happens on several versions of Chromium and Vivaldi as well as Edge.
- It is saved correctly on Firefox 62.0.3 and Chrome 70.0.3538.77
Expected result: If the new language code is valid, save the sense using that language code. If the new language code is not valid, display an error and refuse to save.
Actual result: Sense is saved using the original language code. The newly added sense is displayed using the second language code the user entered, so the problem does not become apparent until the page is refreshed or the history is checked.