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

[Keyboard module] arrow keys change slides regardless of the focused element #7786

Open
5 of 6 tasks
kkesidis opened this issue Nov 5, 2024 · 0 comments
Open
5 of 6 tasks

Comments

@kkesidis
Copy link

kkesidis commented Nov 5, 2024

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-keyboard-control-forked-jrtc5g?workspaceId=56cce242-c538-447d-8ae9-77dc817b70da

Bug description

Focusing on any element and pressing the left or right arrow keys will trigger pagination on the active Swiper.

Using the reproduction link as a reference, if i focus on the button and use the arrows, i see that the swiper below it starts changing slides accordingly.

The button and the swiper instance do not interact in any way and should not affect each other.

Expected Behavior

The swiper instance should be affected by the arrow keys only if the wrapper itself it focused, or a child nested within it.

Actual Behavior

Using the arrow buttons when focused on any element in the page makes the swiper instance scroll, too

Swiper version

v11.1.14

Platform/Target and Browser Versions

firefox 131.0.3, chrome 130

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant