Repository navigation
Tooltip: respect prefers-reduced-motion for the bubble fade-in - #8655
Open
adityalenova wants to merge 1 commit into
Open
adityalenova wants to merge 1 commit into
adityalenova wants to merge 1 commit into
Conversation
Move the `tooltip-appear` declarations behind `@media screen and (prefers-reduced-motion: no-preference)`, matching what TooltipV2 already does, and make the animated end state (`opacity: 1`) the default so the bubble is still shown when motion is reduced.
🦋 Changeset detectedLatest commit: f079b51 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Author
|
@llastflowers I hope you have seen the pull request. I would be delighted if you suggest any modifications related to this pull request. |
siddharthkp
requested review from
siddharthkp
and removed request for
llastflowers
November 2, 2026 21:02
This branch was successfully deployed
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
Tooltip(v1) fades its bubble in withtooltip-appearunconditionally, whileTooltipV2runs the same keyframes behind@media screen and (prefers-reduced-motion: no-preference)with the comment "Only show animations if users don't have a preference for reduced motion". Closes #8650.The part worth reading before reviewing
.Tooltip::aftersetsopacity: 0and depends onanimation-fill-mode: forwardsto reachopacity: 1. So the usual "move the animation into the media query" change would leave reduced-motion visitors with a tooltip that never appears. This change therefore makes the visible state the default and treats the fade as the enhancement:opacity: 1is exactly the value the animation lands on, so the animated result is unchanged;.Tooltip::afterstill keeps the bubble transparent while it is not interacted with.Verification
Two e2e tests added to
e2e/components/Tooltip.test.ts.toHaveCSScannot target a pseudo-element, so they read the computed style of::afteron the trigger:reducedMotion: 'reduce'→animation-name: none,opacity: '1', bubble visible on hover (this is the regression the default-visible rule prevents).reducedMotion: 'no-preference'→animation-namestill resolves totooltip-appear, and the computed opacity still ends at'1'.npx stylelint packages/react/src/Tooltip/Tooltip.module.cssis clean andnpx prettier --checkpasses on all three files. A changeset is included (patch).Note
I know this component is deprecated - the story lives under
Deprecated/Components/Tooltipand is flagged there. The change is four lines and makes v1 behave the way v2 already does. It is still exported to consumers from@primer/react/deprecated, so existing users on that entry point get the fix too — but if you would rather spend no review time on deprecated code, say so and I will close this and keep the issue open for whoever picks up the removal.