Replies: 1 comment 1 reply
-
Can you provide a sandbox? Here some examples that can help https://codesandbox.io/s/dropdownmenu-dialog-items-r9sq1q |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In my current implementation, I have dropdown and alert dialog abstracted into separate components in order to apply styling to them. I make a small API available when using these components, barely exposing anything from the underlying radix components.
I have a situation where I want one of the dropdown item components to open a modal. The thing is, the dropdown item is rendered for a lot of rows, the exact use case being that each row has a delete button within the dropdown and I want the user to confirm this action with the alert dialog.
From a tree view, this is what my code looks like:
This does not work and I'm not sure why. I'm certain that
DropdownMenu.Item
forwards props. The trigger forAlertDialog.Trigger
has theasChild
prop set to true as well.This same exact code works when I use it with a custom button component, with the setup I demonstrated above.
This is the actual code:
The
ConfirmModal
implementation is pretty the same code as the docs (first example)Dropdown.Item
is also a bare bones usage of the component from radix, except that it's wrapped withstyled
from Macaron CSS, which does forward refs and props.Why isn't the dropdown item unable to open the alert dialog?
Beta Was this translation helpful? Give feedback.
All reactions