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

Fix: Prevent default behavior while scrolling using arrow keys in a h… #1612

Merged

Conversation

Jellepostma
Copy link

…orizontal listbox

What I did

  1. Added ev.preventDefault in the left and right arrow key handlers in the listboxmixin, to prevent the listbox from scrolling unintended when using these keys to navigate through the list when it is horizontal. The same fix has been already applied for vertical scrolling.

How to test

  1. On the current master, check the horizontal listbox example using a browser window that is smaller than the width of the listbox. Using arrow keys, it will start scrolling even if the next option is completely in view due to default scrolling behavior of these arrow keys.

@changeset-bot
Copy link

changeset-bot bot commented Feb 28, 2022

🦋 Changeset detected

Latest commit: 1ea9f29

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lion/listbox Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Feb 28, 2022

CLA assistant check
All committers have signed the CLA.

@gerjanvangeest
Copy link
Member

Hi Jelle, thanks for the contribution 💪

Can you add a changeset (yarn changeset) to make the change also ready for release?

@Jellepostma Jellepostma force-pushed the fix/listboxhorizontalscrolling branch from 0b54b38 to 228df6e Compare March 1, 2022 07:02
@jorenbroekema
Copy link
Collaborator

jorenbroekema commented Mar 7, 2022

@Jellepostma looks like you still need to sign the CLA agreement

Edit: as for the CI, needed to rebase on latest master, CI should be happy now

@jorenbroekema jorenbroekema force-pushed the fix/listboxhorizontalscrolling branch from 228df6e to 1ea9f29 Compare March 7, 2022 12:18
@Jellepostma
Copy link
Author

@jorenbroekema Done! Thank you for the rebase :)

@jorenbroekema jorenbroekema merged commit cd2bc13 into ing-bank:master Mar 8, 2022
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

Successfully merging this pull request may close these issues.

None yet

4 participants