-
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
CascadeSelect: dropdown container creates scrolls in page instead of list container #2229
Comments
PrimeVue same issue: primefaces/primevue#3337 |
@melloware this may require adjusting the dom structure, I feel like there will be some breakchanges or css change, I will also try using the portal |
Can you also check what PrimeVue and PrimeNG are doing? |
@melloware in primevue and primereact the sublist has no parent box, if set overflow and absolute for ul, the child elements would be affected |
Do you think we should follow primeng's implementation? This will move This is how I currently implement it e.g. const listWrapperProps = mergeProps(
{
className: cx('sublistWrapper')
},
getPTOptions('sublistWrapper')
);
return props.level === 0 ? <>{ul}</> : <div {...listWrapperProps}>{ul}</div>;
//css
.p-cascadeselect-sublist-wrapper {
position: absolute;
min-width: 100%;
z-index: 1;
display: none;
} |
yep we can probabaly make it like PrimeNG especially if that solves the issue. |
I found PrimeNG has not yet implemented PT and unstyled To fix this problem need to add a new pt |
I'm submitting a ...
Codesandbox Case (Bug Reports)
https://codesandbox.io/s/exciting-villani-vqex4?file=/src/demo/CascadeSelectDemo.js:6294-6507
Current behavior
The issue with cascade select happens when the list is too long for the page to display in available space below the component, so it creates scrolls to the whole page instead of creating scroll just for the list container of the dropdown. When the list have many elements, and those elements have multiple levels.
Expected behavior
I found a custom fix to limit height of the cascade select container to prevent cascade to create scrolls in page and limits the max-height to the space in screen available below the component, the right CascadeSelect uses this strategy, but still, only the second container for the child items are limited and using the scroll as intended, the first level of items is limited to the space but the items are going below the limit without a scroll-y appearing.
We probably need a portal to fix this problem to use only available space in screen to display the dropdown preventing to create scrolls in the whole page, and just create scrolls in the items containers of the list in each level of children items.
Minimal reproduction of the problem with instructions
Please tell us about your environment:
Browser Chrome v92.0.4515.107, OS Windows 10 20h1
"react": "^16.10.2",
"primeflex": "^2.0.0",
"primeicons": "^4.1.0",
"primereact": "^6.4.1",
React version:
16.10.2
PrimeReact version:
6.4.1
Browser:
Javascript
The text was updated successfully, but these errors were encountered: