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

Angular with inline stories interferes with keypress binding #14668

Open
bmayen opened this issue Apr 20, 2021 · 4 comments
Open

Angular with inline stories interferes with keypress binding #14668

bmayen opened this issue Apr 20, 2021 · 4 comments

Comments

@bmayen
Copy link

bmayen commented Apr 20, 2021

Describe the bug
I have components that call a method when an element receives a keypress. For instance, <button (keypress)='foo($event)'>. When enabling inline stories, the keypress event doesn't trigger for certain keys. Spacebar works, but Enter/Return doesn't. If I disable inline stories and go back to iframes, everything works as expected.

Note: I am still pinned to 6.2.0-rc.7 due to #14193

System
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
npm: 7.7.6 - ~/.../node_modules/.bin/npm
Browsers:
Chrome: 89.0.4389.128
Edge: 90.0.818.42
Firefox: 87.0
Safari: 14.0.3
npmPackages:
@storybook/addon-a11y: 6.2.0-rc.7 => 6.2.0-rc.7
@storybook/addon-backgrounds: 6.2.0-rc.7 => 6.2.0-rc.7
@storybook/addon-docs: 6.2.0-rc.7 => 6.2.0-rc.7
@storybook/addon-postcss: ^2.0.0 => 2.0.0
@storybook/addon-viewport: 6.2.0-rc.7 => 6.2.0-rc.7
@storybook/addons: 6.2.0-rc.7 => 6.2.0-rc.7
@storybook/angular: 6.2.0-rc.7 => 6.2.0-rc.7
@storybook/theming: 6.2.0-rc.7 => 6.2.0-rc.7

@marti6jm
Copy link

marti6jm commented Oct 7, 2021

I'm also experiencing this bug but I am not using inline stories - instead I am specifically experiencing this when a control on the page is a json control, with array elements in it.

I'm also in the react version of storybook, rather than angular. Could be two issues, but it being a keypress on enter, seems related.

In other words when I had the control like this, it captured the enter key fine:
Screen Shot 2021-10-07 at 3 23 22 PM

But when I added an element, the enter key stopped working.
Screen Shot 2021-10-07 at 3 23 06 PM

@jcolladosp
Copy link

Hi @bmayen and @marti6jm,
did you find any solution for this?

Thanks

@shilman
Copy link
Member

shilman commented Mar 24, 2023

Please try upgrading to the latest prerelease. Is it still broken there?

Migration guide: https://storybook.js.org/migration-guides/7.0

@jcolladosp
Copy link

Hi @shilman , yes, Im on last RC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants