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

allow keyboard events on shadow root hosts

Open mattclough1 opened this issue 1 year ago • 1 comments

What: Resolves #1153

Why: The current code only allows keyboard entry on elements with a ShadowRoot if the ShadowRoot has a focusable element

How: The getActiveElement function previously checked for the existence of a shadowRoot on the currently active element, since active elements in a shadow DOM make the host element the active element in the light DOM, but this logic ignored the fact that host elements can also be active elements on their own.

Checklist:

  • [N/A] Documentation
  • [x] Tests
  • [x] Ready to be merged

mattclough1 avatar Sep 24 '24 20:09 mattclough1

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3f3a23ad0748c639d33974599e5b3593f40a4ae9:

Sandbox Source
priceless-thompson-vd5dxf Issue #1153

codesandbox-ci[bot] avatar Sep 24 '24 21:09 codesandbox-ci[bot]

Ran into this same issue today. Can we get a release with it?

Artur- avatar Mar 21 '25 11:03 Artur-

Same here, just ran into this issue. Fantastic that it's already solved. Would love a release with it.

coder-se avatar Mar 31 '25 19:03 coder-se