<textarea> on Windows XD does not support Enter key down event

There’s an issue on Windows XD where a <textarea> element does not fire the onKeyDown event for the Enter key. Interestingly, it works fine on Mac.

Any chances for workarounds?

Hi @stojan,

Interestingly enough, the property that doesn’t work in a lot of other places works here: onKeyUp. If that’s an option for you, you could use that.

I did this in my Document Chat plugin, with the relevant source code (written in React) is at https://github.com/pklaschka/chat-xd-plugin/blob/master/src/components/chat/editor/editor.tsx#L102.

If you actually need onKeyDown specifically, it would be useful to know the use-case to think about workarounds :wink:

I hope this helps,
Best,
Pablo

1 Like

Wait, I know the question is for Windows PCs and I haven’t had a chance to test much on it, but is onKeyUp supported in XD? :smiley: Last time I checked (on macOS) it wasn’t (https://twitter.com/mightyalex/status/1243987425719959554)

I don’t really know. Personally, I’ve only been able to test it on WIndows, where, in the example above, it works fine. Since I’ve also had many users on macOS report the Document Chat plugin working, I assume that there must be at least some level of support :wink:.

I also, during development, thought that it would only work with onKeyDown, which, as this thread states, actually doesn’t work. When, instead, I used onKeyUp, it began to work :rofl:

1 Like