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

When clicking Cancel on a Confirm Dialog, it opens again once #66

Open
cromoteca opened this issue Mar 15, 2023 · 1 comment
Open

When clicking Cancel on a Confirm Dialog, it opens again once #66

cromoteca opened this issue Mar 15, 2023 · 1 comment
Labels

Comments

@cromoteca
Copy link
Contributor

In my Confirm Dialog example, if I click on Cancel, the dialog reopens once.

I'm using version 2.1.0-alpha1.

Screencast.from.2023-03-15.12-36-14.webm
@platosha platosha added Severity: Minor bug Something isn't working Impact: Low labels Mar 21, 2023
@platosha platosha removed the hilla label Nov 1, 2023
@web-padawan web-padawan self-assigned this Dec 6, 2023
@web-padawan
Copy link
Member

This issue appears to be related to the fact that there is a standard HTML cancel event used by <dialog> component, so React adds event listener for it with useCapture: true on the root node. I'm not sure how exactly it affects onCancel but calling setStatus causes the component to re-render with opened still set to true, which opens the dialog again.

@web-padawan web-padawan removed their assignment Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants