StandardChip placeholder icon color not changing when disabled
See original GitHub issueStandardChip placeholder icon should have an alpha applied in order to change the color when on disabled state.
Compare:
Our implementation relies on Chip from androidx.wear.compose.material
which seems to implement this functionality. From the kdoc:
In order to correctly render when the Chip is not enabled the icon must set its alpha value to [LocalContentAlpha].
However, our implementation uses Coil’s rememberAsyncImagePainter to display a placeholder, which receives a Painter
type as placeholder, and might not work well with that alpha applied in Chip.
Expected outcome from this task
- PrimaryChip preview for disabled state displays placeholder icon with correct alpha applied
- SecondaryChip preview for disabled state displays placeholder icon with correct alpha applied
- Other previews for PrimaryChip and SecondaryChip are not affected
- PrimaryChip snapshot test for disabled state displays placeholder icon with correct alpha applied
- SecondaryChip snapshot test for disabled state displays placeholder icon with correct alpha applied
- Other snapshot tests for PrimaryChip and SecondaryChip are not affected
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why on disabled Pseudo class background color of icon ...
Pseudo class disabled only works on input fields , buttons and select. By adding the background color to disabled class it works.
Read more >An icon doesn't change color when making an instance ...
My icons have the same layer names (“Icon”) and still, color overrides are not preserved. Here you can see a link component with...
Read more >Disabled people - Free people icons
Free vector icon. Download thousands of free icons of people in SVG, PSD, PNG, EPS, and icon font formats.
Read more >Changing Icon Color in Iconify SVG Framework
Some icons, such as emoji, have a hardcoded palette that cannot be changed. To change color of a monotone icon simply change text...
Read more >Chips | Angular Material
Unlike other chips, the user can focus on disabled chip options inside a ... When a chip is not selectable, changes to its...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@oas004 if you can see it fixed with this, please put up a PR. Thanks!
Hey, I was trying to look into this and I was wondering; is there a reason why you can not just apply a LocalContentAlpha.Current to the image if it is disabled? 😄 From the previews it seems correct, but I got thrown off by this
Does that mean that I would need to deprecate and alter the api to not get a painter as a placeholder? and then use something else than rememberAsyncImagePainter?
With the alpha applied to the images, it looks like this for the placeholder disabled preview