testing-library / testing-library/user-event

User keyboard events don't trigger the <details /> element

Open
#1,264 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs assessment
Dominant language
TypeScript
Stars
2.3k
Forks
258
PR merge metrics
No merged PRs in 30d

Description

Reproduction example

https://codesandbox.io/p/sandbox/still-sound-xhs3hn

Prerequisites
  1. Render the details and summary element with collapsible content
  2. Focus the summary element
  3. user.keyboard('[Enter]') or user.keyboard('[Space]') should trigger details to be open
Expected behavior

user.keyboard('[Enter]') or user.keyboard('[Space]') should trigger details to be open

Actual behavior

user.keyboard('[Enter]') or user.keyboard('[Space]') does NOT details to be open

User-event version

14.5.1

Environment

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked CodeSandbox reproduction and inspect the user.keyboard('[Enter]') and user.keyboard('[Space]') paths described in the issue. Done means focusing a summary element and using either key opens its details element, with coverage for both keyboard inputs.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.