Update Radio button to material 3#111774
Conversation
There was a problem hiding this comment.
Shouldn't we check for MaterialState.selected first as in overlayColor since there's 2 sets of tokens for unselected and selected?
There was a problem hiding this comment.
Yes, selected is handled before unselected here. The order here is firstly checking disabled states, then selected, then unselected in pressed/hovered/focused states. If the button is disabled, both selected and unselected states return a same value for the fillColor, so I only put a unselected.icon token in disabled condition.
There was a problem hiding this comment.
I meant to say, for example, that while we're handling the disabled unselected case, we're not handling the disabled case. Same goes for other selected states. overlayColor handles these states correctly.
There was a problem hiding this comment.
When the button is disabled, both selected and unselected tokens map to same value (color), so I only used the md.comp.radio-button.disabled.unselected.icon here for both selected and unselected cases. Should we handle each condition even if they have same values, or we can update them later only if the tokens become different?
There was a problem hiding this comment.
While we haven't been doing this in a disciplined way, if it is easy to support driving this from the tokens (even if the current tokens result in the same values), then we should probably do so.
There was a problem hiding this comment.
I see. Fixing it. Thanks!
There was a problem hiding this comment.
We should use tokens as if they were different, which they may be in future updates.
There was a problem hiding this comment.
Sure. Fixed it. Thanks!
197ceb3 to
01ebde7
Compare
Part of: #91605
Updated the
Radiowidget with support for Material Design 3.In order to use the
Radiowith the new Material 3 defaults, turn on theuseMaterial3flag in theThemeData:Fixes: #111450
Pre-launch Checklist
///).