Does userEvent.keyboard('[Enter]') work? #1164
Replies: 1 comment
-
So, im not sure what the docs are saying about the KeyboardEvent.code syntax being the only working one. What does it mean that you should use KeyboardEvent.code instead, does that mean use the keyboard('[Enter]') bracket syntax? However, i did find out that the keyboard('[Enter]') does work on a regular I will close this now |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@kentcdodds
@tlrobinson
@gnapse
@ph-fritsche
I am using user-event v14
i have tried using
await userEvent.keyboard('{Enter}');
andawait userEvent.keyboard('[Enter]');
and i cant get it to trigger on an ionic search input field. I can get space, and tab, and other modifier keys to work, just not 'Enter'. Is there a known issue with the 'Enter' modifier key? ive also tried lowercase '{enter}', andawait userEvent.type(input, "{enter}");
with no luck. The code for Enter is just '[Enter]' right?Or does this '[Enter]' code just not work on some elements/components?
I have read some places that you need to use the KeyboardEvent.code syntax, which i believe is the
keyboard('[Enter]')
syntax, but still no luck. i can getkeyboard('[Space]')
to work, so i know it works with some. However, the docs are super confusing, since they show examples mainly using the{Shift}
syntax, which it seems is deprecated?What am I doing wrong? I cant find any current threads on this, or any examples of 'Enter' in the docs. Just old threads before v14, and those weren't too helpful.
Thank you for the help!
Beta Was this translation helpful? Give feedback.
All reactions