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

Shortcuts: Execute preventDefault only if keyboard shortcuts are enabled #23412

Merged
merged 2 commits into from Aug 29, 2023

Conversation

Spielboerg
Copy link
Contributor

Related issue #23351

What I did

Currently, on every keyboard event preventDefault() is called. This PR changes this behavior so this is only done if keyboard shortcuts are enabled.

⚠️ Disclaimer: I was not able to generate a sandbox locally with a different config than the default one (I wanted to disable the shortcuts). So I was not able to test if my changes actually work. If you can help me to set up a sandbox with disabled shortcuts I can test it myself, otherwise, I kindly ask if you can test it yourself.

How to test

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

Otherwise the shortcuts will be blocked for browser plugins or own components
Copy link
Contributor

@kasperpeulen kasperpeulen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@kasperpeulen kasperpeulen changed the title Execute preventDefault only if keyboard shortcuts are enabled Manager: Execute preventDefault only if keyboard shortcuts are enabled Aug 15, 2023
@kasperpeulen kasperpeulen changed the title Manager: Execute preventDefault only if keyboard shortcuts are enabled Shortcuts: Execute preventDefault only if keyboard shortcuts are enabled Aug 15, 2023
@kasperpeulen kasperpeulen self-assigned this Aug 15, 2023
@yannbf yannbf merged commit ce3d0c5 into storybookjs:next Aug 29, 2023
50 of 53 checks passed
@github-actions github-actions bot mentioned this pull request Aug 29, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants