Skip to content
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

Dialog.Trigger not work with conditional childs #616

Open
HussainAhmadDev opened this issue Oct 24, 2024 · 0 comments
Open

Dialog.Trigger not work with conditional childs #616

HussainAhmadDev opened this issue Oct 24, 2024 · 0 comments

Comments

@HussainAhmadDev
Copy link

In the provided snippets you can see I wrapped my conditional button with Dialog.Trigger but it does not work for both of the buttons.
The one solution was to wrap Dialog.Trigger for both of the buttons in there component means if two conditional buttons than two Dialog.Trigger - but I don't like this approach so need some solution.

 <Dialog.Root>
      <Dialog.Trigger>
        {data ? <EditReceiverButton /> : <AddReceiverButton />}
      </Dialog.Trigger>
      <Dialog.Content className="relative max-w-[1000px]">
        <CloseDialogTrigger />

        <Dialog.Title className="font-sans -tracking-[0.25px]">
          {data ? 'Edit' : 'Add'} Receiver
        </Dialog.Title>

        <ReceiverForm  />
      </Dialog.Content>
 </Dialog.Root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant