-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Add anchor to the textfield, not the Window position #6162
Comments
How did you define your AutoComplete's prop If the menu is anchored to the window, it may sound like a missing |
Same problem here.
where would you put a |
Nevermind, without any code to review, i was assuming some dynamic function assigned to anchorOrigin. Such function must have |
My apologies for not supplying code. My component is set out the same as @jadus. I am also able to recreate this is in the material-ui docs: However, In Autocomplete, if I apply Looking at the Popover source I've noticed the reference is pointing to window. Is there any way I can map the reference to the div? |
which line ? |
From material-ui/src/Popover/Popover.js, Line 406:
Looks like the target points to window and scroll position is handled here. |
The same problem. I had to be used https://github.com/moroshko/react-autosuggest instead. |
Using something like tether would make sense here. |
here's a hack, one ugly hack....
ugly, but works for now... I tried another AutoComplete component, but it has same issue when it's on a scrollable container |
Closed by #4783 |
Though this is a bit old thread, We (my friend Guy helped here quite as much) would like to offer the solution we found which is actually offered by the material-ui AutoComplete component. The AutoComplete component has a property named scrollableContainer which purpose is just that. Define the container component which the pop-over (drop-down) should cling to when it is scrolling. For example, if you set it to the dialog that contains the AutoComplete component - when the dialog scrolls, the drop-down list moves accordingly. let myDOMobject = ReactDom.findDOMNode(myReactComponent); where |
Description
Currently the Autocomplete popover responds when the entire window is scrolled. Is it possible to set it so that it anchors to a particular container scroll?
Images & references
In the example, the window was set to a height of 140% for the purpose of showing that the popover responds to the window, but not the container.
The text was updated successfully, but these errors were encountered: