Nikki added a comment.

  I noticed that the dropdown is the same one used for monolingual text 
languages and - indeed - the one for monolingual text has the same problem with 
the language code not being detected on middle click paste. Although, 
thankfully, it's much less destructive there, since it doesn't allow saving 
when it thinks a field is empty.
  
  It can lose changes to the language though if you edit an existing statement. 
When the field is blank, it uses the initial value, so if you make some other 
change to the statement and you change the language by deleting the language 
and middle click pasting the new code, it won't save the change to the code.
  
  It seems the input field only reacts to keydown events and naturally a middle 
click paste does not trigger a keydown event. I tried running 
`$(".ui-suggester-input").on("input", function () { this.dispatchEvent(new 
Event("keydown")); });` in the console (after clicking edit, before doing 
anything else) and that made it behave as expected for me - so perhaps it 
should be reacting to input events instead of keydown events?

TASK DETAIL
  https://phabricator.wikimedia.org/T269070

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Nikki
Cc: LucasWerkmeister, Nikki, Akuckartz, Nandana, Lahi, Gq86, GoranSMilovanovic, 
Mahir256, QZanden, LawExplorer, _jensen, rosalieper, Bodhisattwa, Scott_WUaS, 
Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to