testing-library / testing-library/user-event
Firefox: userEvent.click does not submit forms
Open
Nobody has claimed this yet.
bug
needs investigation
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction example
https://codesandbox.io/s/nervous-microservice-nmm3h7?file=/src/index.js
Prerequisites
- Use Firefox, not jsdom.
- Render a form with an onSubmit handler and a button inside the form such as
<button type="submit" />. - Use
userEvent.clickto click the button in the form.
Expected behavior
Form's onSubmit handler should trigger.
Actual behavior
Form's onSubmit handler does not trigger.
User-event version
14.4.3
Environment
Firefox 106.0.2 (64-bit) Linux
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction in src/index.js from the linked CodeSandbox and run it in Firefox rather than jsdom, then trace the userEvent.click entry point. Done means a submit button's form onSubmit handler fires under Firefox as described in the expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100