New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TextField] Fix error focus style #35167
Conversation
|
Changes detected by argos is as expected |
[`&:before, &:hover:not(.${filledInputClasses.disabled}):before`]: { | ||
borderBottomColor: (theme.vars || theme).palette.error.main, | ||
}, | ||
'&:after': { | ||
borderBottomColor: (theme.vars || theme).palette.error.main, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this part for? looks unrelated to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think I got it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to change the color on the bottom border, before focus. Without it it would flicker between blue & red on transform
'&:focus-within:after': {
borderBottomColor: (theme.vars || theme).palette.error.main,
transform: 'scaleX(1)', // error is always underlined in red
},
[`&:before, &:hover:not(.${filledInputClasses.disabled}):before`]: { | ||
borderBottomColor: (theme.vars || theme).palette.error.main, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rather do this instead.
// line 115
[`&:hover:not(.${filledInputClasses.disabled}):not(.${filledInputClasses.error}):before`]: {
borderBottom: `1px solid ${(theme.vars || theme).palette.text.primary}`,
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, this will also fix a difference between MUI & Material on hover bottom-border width. I will push the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my comment.
5a311e4
to
d973845
Compare
@siriwatknp Changes done as requested. Please have a new look 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Need final review from @oliviertassinari
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 👌
👍 @siriwatknp Could you resolve comments & update review from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks for your contribution!
This reverts commit df49d6a.
Fixes Input & FilledInput error focus state style. Fixes #35353
According to Material these should be 1px default & 2px on focus. Thus having a visible focus state.
In MUI these are currently 2px default & without any focus state.
Focus visible is an accessibility requirement by WCAG 2.4.7