user-event icon indicating copy to clipboard operation
user-event copied to clipboard

Should not be able to type on inert items

Open codingedgar opened this issue 1 year ago • 1 comments

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/[email protected]

JS framework: [email protected]

Test environment: [email protected]

DOM implementation: [email protected]

Additional context

https://github.com/storybookjs/storybook/issues/27138

https://github.com/capricorn86/happy-dom/issues/1422

https://github.com/jsdom/jsdom/issues/3605

codingedgar avatar May 15 '24 04:05 codingedgar

children of inert element shouldn't be even be ably to queried with get* methods without explicit { hidden: true } option

Guria avatar Feb 17 '25 13:02 Guria