testing-library / testing-library/user-event
Inputs are not focused when clicked (v14)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction example
https://github.com/IanVS/storybook-testing-user-event-click-focus
Prerequisites
- Using V14, try to click an input field:
await userEvent.click(getByRole('textbox'));for example
Expected behavior
The input element should be fully focused, ready to accept user input (flashing cursor).
Actual behavior
The input is half-way focused, with a focus ring, but no flashing cursor.
User-event version
14.3.0
Environment
Testing Library framework: @testing-library/react@13.3.0
JS framework: react@18.2.0
Test environment: storybook@6.5.9
DOM implementation: browser
Additional context
This was working correctly in V13. I have instructions in the README of the reproduction of how to verify.
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 linked reproduction repository and its README, then run await userEvent.click(getByRole('textbox')) under user-event v14. Compare the result with v13 and trace the click behavior from userEvent.click; done means the textbox is fully focused and shows a flashing cursor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100