Skip to content

fix(chip): show the activated background when pressing a hovered chip - #31736

Merged
thetaPC merged 4 commits into
ionic-modularfrom
chip-state-order
Nov 12, 2026
Merged

thetaPC merged 4 commits into
ionic-modularfrom
chip-state-order

Conversation

@thetaPC

@thetaPC thetaPC commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Issue number: internal


What is the current behavior?

Pressing a hovered chip with a mouse keeps the hover background instead of the activated one, because chip.scss writes the activated rules before the focus and hover rules. In the ios and md themes, the background stays at the hover opacity (0.16) instead of the activated one (0.2). The ionic theme doesn't set separate hover or activated backgrounds, so it looks the same either way.

What is the new behavior?

  • Chip states are written in the order focus, hover, activated, matching button and the recipe conventions, so the activated background wins when a chip is both hovered and pressed.
  • Added a test that presses a hovered chip for each hue, fill and color, and expects the activated background.

Does this introduce a breaking change?

  • Yes
  • No

Other information

next has the same order, so this is a fix rather than a migration regression. Raised in the review of #31727.

To check by hand, use a mouse on the chip basic page in the ios theme, then hover a chip and hold the mouse button down. The background should darken past the hover color.

@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Nov 12, 2026 10:53pm UTC

Request Review

@github-actions github-actions Bot added the package: core @ionic/core package label Nov 11, 2026
@thetaPC thetaPC mentioned this pull request Nov 11, 2026
1 of 2 tasks
@thetaPC
thetaPC marked this pull request as ready for review November 11, 2026 22:52
@thetaPC
thetaPC requested a review from a team as a code owner November 11, 2026 22:52

@ShaneK ShaneK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this! The reorder matches the focus, hover, activated order from the recipes doc, and the new test covers every hue, fill and color combo. Left one tiny optional nit, feel free to ignore it.

@thetaPC
thetaPC merged commit 5012681 into ionic-modular Nov 12, 2026
54 checks passed
@thetaPC
thetaPC deleted the chip-state-order branch November 12, 2026 23:17

This branch was successfully deployed

1 active deployment
Preview — 814bfbee Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants