-
Notifications
You must be signed in to change notification settings - Fork 1.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
Prevent multiselect/dropdown box from closing on page scroll #5872
Comments
It works fine try mine: https://stackblitz.com/edit/rhacf7?file=src%2FApp.tsx,src%2Findex.css Key is your body CSS has to overflow: body {
margin: 0px;
min-height: 100%;
overflow-x: hidden;
overflow-y: auto;
background-color: var(--surface-ground);
font-weight: normal;
color: var(--text-color);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
} |
It's working perfectly when the dropdown is outside the dialog. How can I fix the dropdown inside the dialog without setting the dialog height to 100%? |
Inside the dialog you need to use the |
What should it be appended to? Here's an example in a dialog with a TreeSelect that closes the menu on scroll: |
Describe the bug
When using the
multiselect
ordropdown
component, when you open theselect box
and scroll vertically on the page, theselect box
closes automatically, and there's no way to keep it open.The most frustrating part is that in the documentation, the
select box
remain open even if you scroll on the page, but in practice, it's impossible to keep them open...Reproducer
https://c3tk48.sse.codesandbox.io/
PrimeReact version
10.3.1
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
Do not close automatically the
select box
when scrolling on the page or add an option to manage it (Dropdown
andMultiSelect
components)The text was updated successfully, but these errors were encountered: