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

Autocomplete disablePortal breaks Popper behavior #23471

Closed
2 tasks done
BrentFarese opened this issue Nov 10, 2020 · 1 comment · Fixed by #23263
Closed
2 tasks done

Autocomplete disablePortal breaks Popper behavior #23471

BrentFarese opened this issue Nov 10, 2020 · 1 comment · Fixed by #23263
Assignees
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module!

Comments

@BrentFarese
Copy link

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

The Autocomplete component allows a developer to pass disablePortal. The disablePortal implementation is found here. Because the implementation simply relies on absolute positioning of a <div />, it breaks functionality of the Popper component that contains the Autocomplete options. For instance, the list options don't flip their anchor position when they encounter the edge of the browser window.

Expected Behavior 🤔

disablePortal should maintain the existing functionality of the Popper.

Steps to Reproduce 🕹

Steps:

Create an Autocomplete component and use disablePortal and observe when the list box options encounter the browser window edge, no flipping of the list box options occurs.

Context 🔦

We are using disablePortal as we have a click-away listener around the Autocomplete and it only works if the list box options stay within the DOM hierarchy of the Autocomplete. But, the disablePortal breaks the UI functionality of the Popper. We are going to try now just creating our own custom Popper to use with the Autocomplete that doesn't rely on a portal.

Possible Fix: Simply leverage the disablePortal prop on Material-UI's Popper component to preserve UI behavior but provide a disablePortal option to the Autocomplete?

Your Environment 🌎

Tech Version
Material-UI v4.10.2
Material-UI-Lab 4.0.0-alpha.56
React 17
Browser Chrome
TypeScript Y
@BrentFarese BrentFarese added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 10, 2020
@oliviertassinari
Copy link
Member

@eps1lon works on this problem in #23263.

@oliviertassinari oliviertassinari added component: autocomplete This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 10, 2020
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: autocomplete This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants