Skip to content

INSTUI-4567 fix(ui-view): fix focus outline showing when setting a global :hover CSS rule for outline#1992

Merged
matyasf merged 1 commit into
masterfrom
fix_hover_button
May 29, 2025
Merged

INSTUI-4567 fix(ui-view): fix focus outline showing when setting a global :hover CSS rule for outline#1992
matyasf merged 1 commit into
masterfrom
fix_hover_button

Conversation

@matyasf

@matyasf matyasf commented May 28, 2025

Copy link
Copy Markdown
Collaborator

Currently we are animating the focus ring, on the normal state its a CSS outline with 0 alpha. If the outline is overridden (e.g by a global :hover CSS rule by Bootstrap) it will be animated because its different from the global default.

To test:
Add this to the global CSS:

a:hover {
  outline: 8px solid red;
}

Then hover over this button: <Button href="google.com">Add Program</Button>, there should be no red rectangle flashing

@matyasf matyasf self-assigned this May 28, 2025
@github-actions

github-actions Bot commented May 28, 2025

Copy link
Copy Markdown
PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-05-29 11:44 UTC

@matyasf matyasf requested review from balzss and joyenjoyer May 28, 2025 20:19
@matyasf matyasf changed the title fix(ui-view): fix focus outline showing when setting a global :hover CSS rule for outline INSTUI-4567 fix(ui-view): fix focus outline showing when setting a global :hover CSS rule for outline May 29, 2025
@matyasf matyasf changed the title INSTUI-4567 fix(ui-view): fix focus outline showing when setting a global :hover CSS rule for outline INSTUI-4567 fix(ui-view): fix focus outline showing when setting a global :hover CSS rule for outline May 29, 2025
@matyasf matyasf force-pushed the fix_hover_button branch from fc6ba46 to 23333ac Compare May 29, 2025 09:23
Comment thread packages/ui-view/src/View/styles.ts Outdated
Comment on lines 305 to 308

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the actual fix

…e for outline

currently we are animating the focus ring on focus, on the normal state its a CSS outline with 0
alpha. If the outline is overridden it will be animated because its different from the global
default. This change fixes it by setting the :hover and :active outline states to the same
value as the default focus outline.

Fixes INSTUI-4567
@matyasf matyasf force-pushed the fix_hover_button branch from 23333ac to 6566c5c Compare May 29, 2025 09:29
@matyasf matyasf merged commit 00cfba9 into master May 29, 2025
12 checks passed
@matyasf matyasf deleted the fix_hover_button branch May 29, 2025 11:44
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.

3 participants