testing-library / testing-library/user-event
Should not be able to type on inert items
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/storybookjs/storybook/issues/27138
Prerequisites
<form inert="true">
<input placeholder="not focusable" />
</form>
should not be able to click, focus or write with
await expect(input).toBeEnabled();
await userEvent.type(input, 'can write');
Expected behavior
If an element is inert it should fail to write and fail expects
Actual behavior
nothing happens
User-event version
14.5.2
Environment
Testing Library framework: @testing-library/react@13.4.0
JS framework: react@18.3.1
Test environment: vitest@1.4.0
DOM implementation: happy-dom@13.8.6
Additional context
https://github.com/storybookjs/storybook/issues/27138
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 by reproducing the form and input example with the listed userEvent.type call, then inspect the user-event handling for enabled, focus, and typing checks. Done means inert inputs reject clicking, focusing, and typing, and a regression test verifies the expected failure behavior across the relevant DOM environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100