fix(QTooltip): show on keyboard focus & dismiss with ESC (fix #18241)#18318
Open
arbaev wants to merge 1 commit into
Open
fix(QTooltip): show on keyboard focus & dismiss with ESC (fix #18241)#18318arbaev wants to merge 1 commit into
arbaev wants to merge 1 commit into
Conversation
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.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
devbranchfix #18241)Other information:
Fixes #18241.
Problem
QTooltip only showed on mouse hover (and touch), so keyboard-only users never saw it when tabbing to the target — a violation of WCAG 1.4.13 (Content on Hover or Focus).
Change
In the tooltip's anchor wiring (desktop):
:focus-visibleso the tooltip does not appear on plain pointer clicks (mouse users keep hover).blur.ESCwhile shown, via Quasar's shared escape-key stack (same mechanism as QMenu/QDialog) — only the top-most popup reacts and focus is not moved (WCAG "dismissible").No new props/events; respects the existing
noParentEventandpersistent.The touch/mobile path is unchanged.
Scope / note
A focusable trigger is required (QBtn, links, inputs…). A tooltip on a non-focusable element (a bare
<div>withouttabindex) still can't receive focus — that remains the app's responsibility.Verification
Built from source and exercised in headless Chromium (Playwright):
:focus-visible) → not shownCordova/Electron not separately tested — the change uses standard DOM
focus/blur+:focus-visibleand the existing escape-key stack, with no platform-specific code. No unit test added: QTooltip currently has no test file and the spec harness requires full-API coverage for any existing test file; the:focus-visiblegating also can't be exercised under jsdom.Happy to follow up with full QTooltip test coverage separately.