Skip to content

fix(Chip): switch the checkmark and radio dot at once instead of fading them - #11050

Open
langz wants to merge 2 commits into
mainfrom
fix/chip-indicator-motion
Open

langz wants to merge 2 commits into
mainfrom
fix/chip-indicator-motion

Conversation

@langz

@langz langz commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

When a chip is selected or cleared, its background and border change at once, but the checkmark or radio dot inside it fades in or out over 200ms. The indicator visibly lags behind the chip and leaves a faint "ghost" checkmark while unselecting.

On iPhone, the fade also makes icons next to the indicator jump. In the Flags and logos demo, the DNB Avatar is drawn half a pixel lower while the radio dot fades, then snaps back when the fade ends.

The chip now switches its indicator together with the rest of its look. This also applies to the checkbox-button and radio-button variants of Field.Toggle, Field.Boolean, Field.ArraySelection and Field.Selection, which render chips. Standalone Checkbox and Radio keep their animation.

Recordings on iPhone

Screen recordings from Safari on an iPhone, on eufemia.dnb.no before this change. The previews are cropped to the chips, and each one links to the full recording (MP4 download). The thick border that stays after a tap is the sticky hover, which #11010 fixes.

Recording of the Checkbox chip in the Variants and icons demo being tapped on and off. The chip changes at once, but the checkmark fades in and out after it.

Recording of the Norway checkbox chip and the DNB radio chip in the Flags and logos demo being tapped. The checkmark and the radio dot fade after the chips change, and the DNB Avatar shifts slightly while the dot fades.

Before / after

Each row shows the chips the given time after they were selected.

Norway (checkbox) and DNB (radio) chips 0, 50, 100 and 200 ms after being selected. Before: the chips look selected at once, but the checkmark and radio dot fade in over 200 ms. After: the checkmark and dot are shown at once.

Six frames of the DNB Avatar from an iPhone screen recording. In the four frames while the radio dot fades, the Avatar sits lower and looks softer. In the two frames after the fade, it snaps back up.

ToggleButton had the same issue and is fixed in #11051. The sticky hover after a tap is fixed separately in #11010.

The chip changes its background and border at once, but the nested
Checkbox and Radio fade their indicator over 200ms. The indicator lags
behind the chip, and in iOS Safari the fade makes icons next to it, such
as an Avatar, jump when it ends.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
langz

This comment was marked as outdated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@joakbjerk joakbjerk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. The rule sits inside .dnb-chip, next to the existing chip overrides for the checkmark and radio dot, so standalone Checkbox and Radio keep their fade.

Non-blocking: the latest commit removes the e2e test, and Chip has no CSS snapshot test, so no test would fail if this rule were dropped later. Was that on purpose?

@langz langz left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Final review of ab5fceb: no critical findings.

  • Adjusted in this round: removed the e2e test. The PR now only changes dnb-chip.scss.
  • Verified with the published package instead of the Portal. A standalone Vite + React app installed the npm release (11.18.1), the main build (9365a68) and this PR's build from pkg.pr.new (1a4e53a, same CSS as this commit). It clicked 15 scenarios in Chromium, Firefox and WebKit, with four ways of loading the styles: all-in-one, isolated style scope, per-component imports with Checkbox and Radio last, and the Sbanken theme.
    • In the release and on main, the checkmark and radio dot fade in every chip with an indicator, and in the checkbox-button and radio-button variants of Field.Toggle, Field.Boolean, Field.Selection and Field.ArraySelection.
    • With this PR, none of them fade, in every engine and style setup. Standalone Checkbox and Radio still fade, and ToggleButton still fades until #11051.
    • Once the selection has settled, every page is pixel-identical to main.
  • The rule ships in dnb-chip.css, the components bundle and every theme bundle, in both the plain and the isolated variant, and outranks the Checkbox and Radio transitions in all of them.
  • The Avatar jump doesn't happen in desktop WebKit, even at 3x, so it is still only confirmed by the iPhone recording.
  • CI for this commit was still running when this review was posted.

@langz

langz commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

@joakbjerk Thanks! Yes, that was on purpose. The fix was verified against the published package in Chromium, Firefox and WebKit instead (see the review above), and we prefer not to add tests that assert declarations in compiled CSS.

This branch was successfully deployed

2 active deployments
Package preview — ab5fcebc Deployed Nov 24, 2026 by github-actions[bot]
Portal preview — ab5fcebc Deployed Nov 24, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants