Skip to content

Let scrollbar clicks pass through the Qualified widget strip - #3972

Open
paoloredis wants to merge 2 commits into
mainfrom
DOC-7044
Open

Let scrollbar clicks pass through the Qualified widget strip#3972
paoloredis wants to merge 2 commits into
mainfrom
DOC-7044

Conversation

@paoloredis

@paoloredis paoloredis commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

On production the Qualified chat widget (injected via GTM, not part of this repo) restyles to overflow:hidden so becomes the page's scroll container, and parks an invisible ~20px-wide, full-height, max-z-index iframe (#q-messenger-frame) against the right edge of the viewport — exactly where body's scrollbar sits. Chrome hit-tests its scrollbars before page content, but Firefox hit-tests content first, so the invisible strip swallowed every click and hover on the scrollbar: it never reacted and, with overlay scrollbars, never faded in. Reported as 'the scrollbar doesn't show up on Firefox'; never reproduces on hugo server because GTM only runs on production.

Disable pointer events on the strip while the chat is closed. The widget sets the q-docked attribute on whenever the panel is open (on mobile too, where the docked width is 0), so scoping the override to html:not([q-docked]) hands pointer events back to the open panel.

Verified by hit-testing (elementFromPoint) a repro page built from the widget's captured stylesheet plus a simulated messenger iframe: without the fix the strip captures the point next to the scrollbar; with the fix clicks pass through; with q-docked set the frame captures again.


Note

Low Risk
CSS-only, production-widget-specific selectors with !important; no auth or data paths, though layout could shift slightly when the widget is active.

Overview
Adds Qualified chat widget overrides in index.css for production (GTM-injected widget), scoped with q-docked-target / q-docked on <html>.

While the panel is closed, the widget’s width/margin compensation is neutralized so <body>’s scrollbar stays at the viewport edge and is not clipped by html { overflow: hidden }. When the widget is active, scrollbar-gutter: stable is turned off on html so it does not double-reserve gutter space inside the widget layout.

For Firefox, pointer-events: none is applied to #q-messenger-frame when the chat is not docked open, so the invisible edge iframe no longer steals clicks/hovers from the page scrollbar; open panel behavior is preserved when q-docked is set.

Reviewed by Cursor Bugbot for commit 7f5cb8e. Bugbot is set up for automated code reviews on this repo. Configure here.

On production the Qualified chat widget (injected via GTM, not part of
this repo) restyles <html> to overflow:hidden so <body> becomes the
page's scroll container, and parks an invisible ~20px-wide, full-height,
max-z-index iframe (#q-messenger-frame) against the right edge of the
viewport — exactly where body's scrollbar sits. Chrome hit-tests its
scrollbars before page content, but Firefox hit-tests content first, so
the invisible strip swallowed every click and hover on the scrollbar:
it never reacted and, with overlay scrollbars, never faded in. Reported
as 'the scrollbar doesn't show up on Firefox'; never reproduces on hugo
server because GTM only runs on production.

Disable pointer events on the strip while the chat is closed. The
widget sets the q-docked attribute on <html> whenever the panel is open
(on mobile too, where the docked width is 0), so scoping the override
to html:not([q-docked]) hands pointer events back to the open panel.

Verified by hit-testing (elementFromPoint) a repro page built from the
widget's captured stylesheet plus a simulated messenger iframe: without
the fix the strip captures the point next to the scrollbar; with the
fix clicks pass through; with q-docked set the frame captures again.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

DOC-7044

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 7 related items from repository history (2 new this commit):

Memory updated at 7f5cb8e

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mich-elle-luna

Copy link
Copy Markdown
Collaborator

I can see the scroll bar flash for a split-second on pages under https://redis.io/docs/staging/DOC-7044/ but it goes away for some reason. Thanks for working on this!

Reviewers on DOC-7044 still saw the scrollbar flash at load and vanish.
The pointer-events fix in the previous commit was real but secondary;
the disappearance itself has a different mechanism.

The Qualified widget replaces root scrolling with a <body> scroller.
At init it measures the root scrollbar width N, then applies
html { width: calc(100dvw - N); margin-right: N; overflow: hidden }
and body { width: calc(100% + N) }, so that body's scrollbar lands
exactly where the root scrollbar was. With overlay scrollbars N = 0 and
nothing breaks, which is why this never reproduced on trackpad Macs.
With classic always-visible scrollbars (Windows, or macOS with a mouse)
N is ~15-17px: body overshoots html's box by N, and html's own
overflow: hidden clips body's scrollbar out of view. The root scrollbar
dies when the widget loads and its replacement is never visible.

While the chat is closed (html[q-docked-target]:not([q-docked])),
neutralize the compensation: html back to 100dvw with no margin, body
back to 100%. Body then fills the window and its scrollbar sits at the
window edge, unclipped. While the panel is docked open the widget's own
geometry applies untouched — verified html still shrinks by the panel
width. Also scope our html { scrollbar-gutter: stable } to auto while
the widget is active: a reserved gutter inside the widget's
overflow-hidden html box would push body's scrollbar inboard again.

Verified against the live staging build in Firefox by injecting these
rules at document start: body flush with the window, a real mouse drag
on the thumb at page top scrolls (previously dead), wheel scrolling
unaffected, and docked mode still lays out correctly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@paoloredis

Copy link
Copy Markdown
Collaborator Author

Could you please try again now @mich-elle-luna ?

@mich-elle-luna mich-elle-luna left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants