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

[SelectField] Scroll wheel event bubbling to parent container #4154

Closed
oskar-koli opened this issue May 4, 2016 · 3 comments · Fixed by #4168
Closed

[SelectField] Scroll wheel event bubbling to parent container #4154

oskar-koli opened this issue May 4, 2016 · 3 comments · Fixed by #4168
Labels
component: select This is the name of the generic UI component, not the React module! v0.x

Comments

@oskar-koli
Copy link

Problem Description

When a user scrolls down a long dropdown menu to get to the bottom, they will usually scroll the mouse wheel much more then necessary just to get to the bottom quickly. The problem with the current implementation is that once the user hits the bottom of the list, the scroll wheel events will bubble up to parent containers, possibly causing the whole page to scroll. This is not a good user experience, reducing the velocity at which users navigate the site and causing frustration. Instead, once the bottom of the list is hit, scrolling the mouse wheel further down shouldn't scroll anything until the user moves the cursor off the SelectField.

I'd propose a "scrollLock" boolean prop (defaults to false) to be added to the "Menu" component (where the scrollable div is), which when set to true stops bubbling of scroll wheel events similarly as seen here. I can do the implementation and make a pull request, but I wanted to get some feedback on this before I begin :)

Versions

  • Material-UI: 0.15.0-beta.2
  • React: 15
  • Browser: Google Chrome 50
@tintin1343
Copy link
Contributor

This sounds reasonable. I would like the other collaborators to also comment on this.

@mbrookes
Copy link
Member

mbrookes commented May 4, 2016

I guess ideally scroll-lock should always be the behaviour when the menu is scrollable, rather than requiring a prop, i.e. if maxHeight < children.length * menuItemHeight.

menuItemHeight is the tricky part, as the user may have styled it differently to the default.

@tintin1343
Copy link
Contributor

@Havdon : Feel free to submit a PR. Thanks!

@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 21, 2022
@zannager zannager added component: select This is the name of the generic UI component, not the React module! v0.x and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! v0.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants