Repository navigation
fix: take the closing flag back when a close is vetoed - #30
Merged
Merged
Conversation
The dialog is flagged as closing a beat before it actually closes, so that a paint landing between close() and the native close event does not make it blink out and back in. The flag was optimistic with no way back: a submit or cancel handler bound after dialogify's own can still call preventDefault(), and the dialog was then left open wearing a class whose `pointer-events: none` made it impossible to interact with. The flag now schedules a guard that takes it back on the next task if the dialog is still open, which covers every veto path rather than each one in turn. The guard is cleared once a close goes through, so an exit animation is never cut short. The closing styles now also require the dialog to have actually closed, so a lingering flag can no longer disable an open dialog on its own. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dialog is flagged as closing a beat before it actually closes, so that a paint landing between close() and the native close event does not make it blink out and back in. The flag was optimistic with no way back: a submit or cancel handler bound after dialogify's own can still call preventDefault(), and the dialog was then left open wearing a class whose
pointer-events: nonemade it impossible to interact with.The flag now schedules a guard that takes it back on the next task if the dialog is still open, which covers every veto path rather than each one in turn. The guard is cleared once a close goes through, so an exit animation is never cut short.
The closing styles now also require the dialog to have actually closed, so a lingering flag can no longer disable an open dialog on its own.