fix: ensure QR scan overlay receives pointer events on modal pages#1544
Open
ug23 wants to merge 1 commit into
Open
fix: ensure QR scan overlay receives pointer events on modal pages#1544ug23 wants to merge 1 commit into
ug23 wants to merge 1 commit into
Conversation
Some web frameworks (e.g. Chakra UI v3 via @zag-js/dismissable) set `pointer-events: none` on `document.body` when a modal dialog is open. Since `#__ga_grayLayout__` is appended as a child of `document.body`, it inherits this style and becomes unable to receive mouse events, making QR code scanning via drag-selection impossible on modal dialogs. Adding `pointer-events: auto !important` to the overlay ensures it always receives pointer events regardless of inherited styles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
Problem
Fixes #1426
The QR code scan overlay (
#__ga_grayLayout__) does not respond to mouse events (drag-selection is impossible) when the target page has a modal dialog open.This occurs because some UI frameworks set
pointer-events: noneondocument.bodywhile a modal is active. For example:@ark-ui/react→@zag-js/dismissable) callsdisablePointerEventsOutside()which setsdocument.body.style.pointerEvents = "none"and only allowspointer-events: autoon the dialog content element.Since
#__ga_grayLayout__is appended as a direct child ofdocument.body, it inheritspointer-events: nonethrough CSS inheritance, making the overlay completely non-interactive — even though it is visually rendered on top viaz-index: 2147483647.Fix
Add
pointer-events: auto !importantto#__ga_grayLayout__insass/content.scss. This ensures the overlay always receives pointer events regardless of any inherited styles from the host page.The
!importantis necessary because the host page sets the style directly ondocument.bodyvia JavaScript (element.style.pointerEvents = "none"), which has high specificity.Testing
npm run chrome— compiles successfully