-
Notifications
You must be signed in to change notification settings - Fork 7
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
Typing storybook shortcuts in inputs triggers them #491
Comments
I made some research and I think I understand why storybook triggers shortcut actions when typing in inputs. I read this interesting article which reveals that:
The key here is that If add an event listener on the storybook root like this: storybookRoot.addEventListener('keydown', (event) => { console.log(event.composedPath(), event.target)}) Therefore I suspect storybook to use the Will try to confirm that by searching in storybook's source code. Seems that could be fixable by using the result from |
Is it possible to block event bubbling so it doesn't exit the shadow dom (not sure we want that though) ? |
Could work but only if the listener of the event which we want to prevent is not directly on the shadow host. But I don't know if it's possible to change the bubbling behaviour of a standard event. |
I wonder if the problem also affects storybook users who create custom elements (web components). |
Fixed in storybook but also since we moved away from shadow dom. |
For example, try typing
s
in an input: it opens / closes the storybook sidebarMight be related to shadow dom? Because I don't remember having the same issues in other projects using storybook
The text was updated successfully, but these errors were encountered: