Skip to content

fix: ensure QR scan overlay receives pointer events on modal pages#1544

Open
ug23 wants to merge 1 commit into
Authenticator-Extension:devfrom
ug23:fix/qr-overlay-pointer-events
Open

fix: ensure QR scan overlay receives pointer events on modal pages#1544
ug23 wants to merge 1 commit into
Authenticator-Extension:devfrom
ug23:fix/qr-overlay-pointer-events

Conversation

@ug23

@ug23 ug23 commented Jun 23, 2026

Copy link
Copy Markdown

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: none on document.body while a modal is active. For example:

  • Chakra UI v3 (via @ark-ui/react@zag-js/dismissable) calls disablePointerEventsOutside() which sets document.body.style.pointerEvents = "none" and only allows pointer-events: auto on the dialog content element.

Since #__ga_grayLayout__ is appended as a direct child of document.body, it inherits pointer-events: none through CSS inheritance, making the overlay completely non-interactive — even though it is visually rendered on top via z-index: 2147483647.

Fix

Add pointer-events: auto !important to #__ga_grayLayout__ in sass/content.scss. This ensures the overlay always receives pointer events regardless of any inherited styles from the host page.

The !important is necessary because the host page sets the style directly on document.body via JavaScript (element.style.pointerEvents = "none"), which has high specificity.

Testing

  • Built with npm run chrome — compiles successfully
  • Tested on a page using Chakra UI v3 modal dialog with QR code — scan overlay now appears and drag-selection works correctly
  • No regression on pages without modals

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>
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

Successfully merging this pull request may close these issues.

QR Code grabber does not work if the dialogue is hidden when a mouseclick is recorded

1 participant