-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Position of select menu not based on scrollable parent #3822
Comments
@JedWatson @mitchellhamilton do you guys have any plan of adding this functionality if I send a PR? I'm still working on a generic fix that works for a scrollable div as well as the default html element but it would not make sense if it won't be merge. Will be waiting for your reply. |
This is pretty similar to the issue I described in 3810 (not quite the same though). We're using fixed menu positioning and configured the dropdown to close on scroll. |
@bzalasky The prob with "fixed" menu position is that, if we scroll the page, the position of menu remains fixed to where it was rendered first and the view doesn't look good with some weird behavior as well (try to hover the mouse over the menu after scrolling the page and then the menu will "try" to move to its desired position, but that also breaks in some cases). |
This is why we opted to close the dropdown when the page is scrolled. It's not perfect, but solved our problem. We actually need fixed positioning in our case because of how the dropdown is rendered inside of a responsive table (to avoid clipping issues for rows near the bottom of the table). I can take a look at your patch. |
@bzalasky I guess if the scrolling is happening inside the menu, then this approach wouldn't work? If both inside/outside menu scroll hides the menu, users won't be able to select options within scrolled down menu. |
Does #3669 solve your problem, @prateek0227 ? |
Hi @prateek0227, I wanted to check in with you and the above issue to see if @IanVS's PR suggestion would have solved your issue. |
@bladey I can't speak for @prateek0227 but it appears the PR would address this same issue I am having. I am not dealing with the scroll-to issue the PR also deals with, but the positioning not being based on nearest scrollable parent as @prateek0227 describes is causing me a lot of problems. |
My apologies @IanVS I guess I missed your previous comments. |
As mentioned in PR 3531,
I'm facing the similar issue when the menu is present near the bottom of the view area inside a scrollable div, in my case a slide panel, the menu's positioning is being based on the window height and not the scrollable parent.
The following are the issues that I'm facing:-
menuPosition = "fixed"
, I'm able to remove the truncation problem, but that brings another issue as the position of menu is not being changed if the parent div is scrolled up or down.I'm working on a fix for the
getMenuPlacement
function insideMenu.js
, and trying to change the calculations based on the scrollable parent instead of using thewindow
every time. If there is no scrollable parent, then the default thing will be working as is.If anyone else is working on this issue, do let me know.
The text was updated successfully, but these errors were encountered: