Autocomplete disablePortal breaks Popper behavior #23471
Labels
bug 🐛
Something doesn't work
component: autocomplete
This is the name of the generic UI component, not the React module!
Current Behavior 😯
The Autocomplete component allows a developer to pass
disablePortal
. ThedisablePortal
implementation is found here. Because the implementation simply relies on absolute positioning of a<div />
, it breaks functionality of thePopper
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 thePopper
.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, thedisablePortal
breaks the UI functionality of thePopper
. 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'sPopper
component to preserve UI behavior but provide adisablePortal
option to the Autocomplete?Your Environment 🌎
The text was updated successfully, but these errors were encountered: