Fix modal dismissing when clicking the panel#307
Merged
Conversation
The modal backdrop is fixed inset-0 (a positioned element) while the panel was static, so the backdrop painted on top of the panel and intercepted clicks — clicking the panel or its form fields hit the backdrop, which triggers cancel and closed the modal. Add `relative` to the panel so it sits above the backdrop and receives clicks, matching the canonical Tailwind modal markup. Assisted by AI
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.
Problem
After #306 made the modal panel visible again, clicking the panel or any of its form fields closed the modal.
The backdrop is
fixed inset-0(a positioned element); the panel was static, so the backdrop painted on top of the panel and intercepted clicks. The click hit the backdrop — whose handler triggerscancel— instead of the panel's@click.stop.Fix
Add
relativeto the panel so it sits above the backdrop and receives clicks (matches the canonical Tailwind modal markup). One-line change in the sharedModalWindow.vue; applies to all modals.Assisted by AI