Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shannenwu99 opened this issue Jan 23, 2025 · 1 comment
Open

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

shannenwu99 opened this issue Jan 23, 2025 · 1 comment
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member

Comments

@shannenwu99
Copy link

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

@shannenwu99 shannenwu99 added bug Something isn't working needs assessment This needs to be looked at by a team member labels Jan 23, 2025
@bschlenk
Copy link

It looks like isClickableInput is how this decides whether a keyup event also sends a click event. The solution might be to add isElementType(element, 'details') to the check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member
Projects
None yet
Development

No branches or pull requests

2 participants