Issue
The keydown
event doesn’t register when pressing Enter inside a textarea
.
Steps to reproduce
- Have a dialog with a
<textarea>
in it (and have a JS reference to that text area aselem
) – I won’t copy and paste all the boilerplate plugin creation code here, but I’ve reproduced it in a minimal example, meaning it should be the case with every dialog creation code out there - Use the following code snippet:
elem.addEventListener('keydown', evt => console.log(evt));
- Run the plugin, click on the textarea (to put it in focus) and hit Enter. Nothing will appear in the developer console (tested on XD 16.0.2.8, Windows 10)…
Expected Behavior
The event should trigger when pressing the Enter key, like in browsers. See a screenshot from Chrome as an example:
Actual Behavior
The event doesn’t trigger (fairly obvious by now )
Additional information
I’m trying to achieve the following behavior:
When the user presses Enter while holding Ctrl inside a textarea of my plugin’s dialog, the dialog should get submitted. Therefore, I require the event to also trigger when pressing Enter… I’ve had this working with simple <input>
elements before, so it’s “exclusive” to the Enter
key in a <textarea>
.