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

TextField component's with select option and disableScrollLock menu stays fixed when scrolling #37752

Closed
2 tasks done
AndriusOL opened this issue Jun 28, 2023 · 8 comments · Fixed by #37773
Closed
2 tasks done
Labels
bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module!

Comments

@AndriusOL
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/bitter-violet-wpfhc4?file=/src/App.js

Steps:

  1. Create TextField in container that can be scrolled
  2. Set select property to true
  3. Set disableScrollLock to true in MenuProps

Current behavior 😯

When select dropdown menu is open and page is scrolled, TextField moves, but menu popper stays in fixed position

Expected behavior 🤔

Expecting for drop down menu to stay attached to it's anchor element and move together on scroll

Context 🔦

No response

Your environment 🌎

No response

@AndriusOL AndriusOL added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 28, 2023
@zannager zannager added the component: text field This is the name of the generic UI component, not the React module! label Jun 29, 2023
@michaldudak
Copy link
Member

Thanks, it looks like a bug. Would you like to contribute to the project by investigating it?

@michaldudak michaldudak added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 29, 2023
@michaldudak michaldudak removed their assignment Jun 29, 2023
@AndriusOL
Copy link
Author

Thanks, it looks like a bug. Would you like to contribute to the project by investigating it?

I am afraid I don't have possibility to look into it anytime soon.

@VishruthR
Copy link
Contributor

I'm open to taking a look at this.

To confirm, the expected behavior is that the dropdown options menu doesn't move on scroll correct?

@AndriusOL
Copy link
Author

I'm open to taking a look at this.

To confirm, the expected behavior is that the dropdown options menu doesn't move on scroll correct?

Menu should be attached to input. When it is opened by default it is attached to bottom center of it's anchor element (in this case it is input or input wrapper div, not sure exactly), but when you scroll, input scrolls with the page, but menu stays in fixed position. Expected behavior for menu is to allways stick to anchor element on scroll.

@VishruthR
Copy link
Contributor

I'm open to taking a look at this.
To confirm, the expected behavior is that the dropdown options menu doesn't move on scroll correct?

Menu should be attached to input. When it is opened by default it is attached to bottom center of it's anchor element (in this case it is input or input wrapper div, not sure exactly), but when you scroll, input scrolls with the page, but menu stays in fixed position. Expected behavior for menu is to allways stick to anchor element on scroll.

This makes sense. Let me start looking into this.

@VishruthR
Copy link
Contributor

Similar to #17353

@faillacec
Copy link

Hi, this issue was solved ? which version of MUI has the fix ?

@DiegoAndai
Copy link
Member

DiegoAndai commented Aug 24, 2023

Hi! It was merged a couple of minutes ago 🎉

The fix will come in the next release next week. The latest is 5.14.6, whichever comes after that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
6 participants