-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
StatefulTable: OverflowMenu should scroll with its container #9082
Comments
Hey there @ravinain, since this may be an issue with the |
Hi, I have created an example here: Overflow-Menu-Issue. Steps to reproduce:
|
@tw15egan this is still a problem, please see my slightly modified fork of the previously shared CodeSandbox: https://codesandbox.io/s/overflow-menu-issue-forked-y6f2d9 |
@petersandor If this is an issue with the |
@tw15egan it doesn't matter what component the |
@petersandor, if you can reproduce the issue with just the overflow menu, please create a new issue so we can properly track a fix. This one seems to be tied to an addon library. |
@tw15egan see screen recording from Carbon React Storybook page: All that is needed is the overflow scroll on the parent container, height limitation and a lot of content before and after the overflow menu. |
From slack: May need to make sure the OverflowMenu has the data-floating-menu-container set to the parent selector (https://react.carbondesignsystem.com/?path=/docs/components-overflowmenu--default#data-floating-menu-container), but the storybook doesn’t have it set and I’m unable to see the same bug If a simplified reproduction can be made, we can work on a fix, but I am unaware of what is causing the issue. |
@tw15egan here's a new CodeSandbox with everything https://codesandbox.io/s/romantic-cloud-lbdm42?file=/src/index.js |
If you wrap the menu in a |
Right, so basically the overflow menu cannot have any sibling elements otherwise the positioning breaks. |
It can have sibling elements; it just needs its position set to a container inside the scrolling container rather than the scrolling container itself. |
I see, this is an undocumented feature of the OverflowMenu though, I can see it is mentioned in the Tooltip which presumably uses the same underlying Thanks for help @tw15egan! |
Sorry for the confusion! If we can improve the documentation regarding this functionality, I'd love to update it to reduce headaches in the future, just let me know what should be copied over from the |
Actually if I may ask one more question, I noticed that the class is not really necesary for the
Which means it selects the overflow menu button itself (I confirmed by removing the attribute's value in your CodeSandbox example). |
@tw15egan isn't that an accessibility violation? The entire overflow menu is inside of the trigger button in your example? Also React complains that the overflow menu item (which is a button) is inside of the trigger button: |
Updated the example https://codesandbox.io/s/dreamy-heisenberg-n41ncd?file=/src/index.js so that it correctly appends to the |
Thanks again @tw15egan. I still think that this is not ideal and the menu should handle this without forcing the consumers of the library to set Other libraries solve this problem by dynamically recalculating the position of the menu which can also be tricky. |
RowAction
OverflowMenu
inStatefulTable
is not scrolling with the container.This issue is similar to #4755 . However, I'm using
StatefulTable
When I set the parent
div
position torelative
, it fixes the scroll issue but introduces another. After scroll, the position of overflow menu is not correct. This is exactly same problem mentioned in the aforementioned ticket.Dependency: carbon-addons-iot-react: 2.145
Browser: Chrome
Expected Behavior:
OverflowMenu
should scroll with container. Also, after scroll the overflow menu should display at correct position.Steps to reproduce the issue
Example:
You can also refer the aforementioned issue #4755.
The text was updated successfully, but these errors were encountered: