userEvent.keyboard('{Enter}')
doesn't trigger form submission when the submit button is outside the form element, even if it’s associated with the form element by using the button's form attribute.
#1220
Labels
bug
Something isn't working
Reproduction example
https://codesandbox.io/p/devbox/user-event-keyboard-enter-repro-6jvyx5?file=%2Fsrc%2FApp.test.tsx%3A26%2C1
Prerequisites
await user.keyboard("{enter}")
.Expected behavior
I expect the mock function given to onSubmit gets called.
Actual behavior
The mock function given to onSubmit doesn't get called
User-event version
14.5.2
Environment
Testing Library framework:
JS framework:
"react": "~18.3.1",
Test environment:
DOM implementation:
Additional context
I feel there are inconsistencies on the implicit submission of forms
The text was updated successfully, but these errors were encountered: