-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(material-experimental/mdc-form-field): fix prefix/suffix padding #22090
Conversation
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, I believe the spec doesn't specify the behavior for multiple leading/trailing icons*
*there is an example with images but that seems a little difference
@mmalerba what does mdc itself do w/ icon-button inside a prefix/suffix? |
@jelbourn The second commit implements the solution we discussed for icon button padding (I still need to clean up the magic numbers once we're happy with the approach though). Updated the demo as well |
src/material-experimental/mdc-form-field/_mdc-text-field-structure-overrides.scss
Show resolved
Hide resolved
4deb876
to
cbcc80c
Compare
addressed the feedback and cleaned things up with comments/variables. also updated the demo, PTAL |
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
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Demo: https://mmalerba-demo-1.web.app/mdc-input
Open question: when a mat-icon-button is placed in the prefix/suffix area the padding is wrong. This is because the spec expects the icon-button to take up a 24px square in the layout. However, in reality the button takes up a 48px square because of its touch target. Should we add custom CSS to add some negative margin around icon buttons in this case? In that case it would look right, but if people tried to put an icon-button plus something else in the prefix/suffix it would look broken. (cc @jelbourn)