-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiContextMenu] Popover has to close before changes made to items are reflected #2579
Comments
Digging deeper, it seems |
#710 is related, but it doesn't fix this instance. |
@lou00011 It seems that if you're just doing selection, you could use EuiSelectable inside of an EuiPopover. There's an example of this concept in the |
I have solved the problem by taking all items out of |
@cchaos Is this issue relevant still? if yes, what all changes do you expect? |
Here's a code sandbox demonstrating the issue - https://codesandbox.io/s/competent-williams-z29jd?file=/index.js When the popup is open, 4 items are shown. The first two use EuiContextMenuItem directly, and tie their check icon to a A couple notes:
Definitely acts like something is cloned, or put in a state; however, I don't see either of those concepts in use at a quick glance. This is an odd bug for sure, feel free to ask for help digging through it if you get stuck! |
+1 attempting to have a context menu item name change when clicked. I'm using |
I'd like to try to better understand the use case for not automatically closing the popover upon selection in the context menu. The most common use-case, is using it as a menu system. Where the options trigger an action elsewhere, similar to a right click menu or an application menu. Another use-case is to make a single-selection type of menu, like pagination. Where the result of the selection is displayed elsewhere but it also only needs to indicate the current selection the first time it pops up. -- If the use-cases that are needed here is to make a multi-select dropdown list, we highly suggest the use of EuiSelectable within a regular EuiPopover. The mechanics are such that it does a much better job at relaying selection including accessibility. If this is not the use-case, please explain further. It'll be much easier for us to understand and help solve. |
That's ultimately what I ended up implementing, toggle the state and then close the popover, and it's a better user experience for this use case. I still think it's a bug that the panels/items don't propagate properly when the Only examples I can think of where this is would really be necessary are
|
I'm also running into this issue. My use case is having a theme selector toggle in the context menu. When I toggle it, the accompanying icon and label do not change (but when closed and re-open, show the change). Is there any plan to fix this or is it just suggested to not use context menu and re-make it using EuiPopover and other components? |
This appears to have been resolved at some point (React 18 changes? some other set of bug fixes?) - I can't reproduce Chandler's above CodeSandbox code in latest EUI main. If anyone in this thread is still encountering this issue on latest EUI, please open a new issue with a minimum reproducible sandbox. |
I wanted to make a context menu where each individual menu element can be toggled. I am doing this by changing the icon from
empty
tocheck
.However, I found that the context menu doesn't reflect the changes on the fly, but the popover must close and reopen for the change to be reflected.
Is intentional? Is there anyway I can make this element reactive like everything else?
The text was updated successfully, but these errors were encountered: