Skip to content

Conversation

jefffriesen
Copy link

Clicking into the select box automatically scrolls the page if the bottom of the select box drops below the viewport. This happens for select boxes that have a lot of options.

I created a prop called scrollOnFocus that defaults to true which behaves just like it did before this commit. Setting scrollOnFocus to false prevents .focus() of the menu, which prevents window from scrolling. There may be reasons for wanting to keep focus (such as accessibility) so the this is opt-in only and non-breaking.

Btw, setting event.preventDefault() in handleFocus did not work for me. That's why I allowed disabling of focus.

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.

1 participant