You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hotkeys triggers if users has focus on an input inside a WebComponent. This is because events that happen in shadow DOM have the host element as the target, when caught outside of the component, see: https://javascript.info/shadow-dom-events
Focus the WebComponent input and press a key triggering the hotKey
Please try and add a codesandbox reproduce the bug:
just press c while focus is inside the input.
Expected behavior
The hotkey is not triggered if the focus element is one of the elements the hook already takes care of when used inside a WebComponent. To solve this, isHotkeyEnabledOnTag should not just use _ref.target but also check if the _ref.composedPath()[0].tagName if the composed property of the event is true, indicating that the event is a composed event that can pass through shadow DOM boundaries, including events from within web components.
The text was updated successfully, but these errors were encountered:
Describe the bug
Hotkeys triggers if users has focus on an input inside a WebComponent. This is because events that happen in shadow DOM have the host element as the target, when caught outside of the component, see: https://javascript.info/shadow-dom-events
To Reproduce
Steps to reproduce the behavior:
Please try and add a codesandbox reproduce the bug:
just press c while focus is inside the input.
Expected behavior
The hotkey is not triggered if the focus element is one of the elements the hook already takes care of when used inside a WebComponent. To solve this,
isHotkeyEnabledOnTag
should not just use_ref.target
but also check if the_ref.composedPath()[0].tagName
if thecomposed
property of the event istrue
, indicating that the event is a composed event that can pass through shadow DOM boundaries, including events from within web components.The text was updated successfully, but these errors were encountered: