Skip to content
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

Merged
merged 1 commit into from
Mar 9, 2021

Conversation

mmalerba
Copy link
Contributor

@mmalerba mmalerba commented Mar 2, 2021

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)

@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 2, 2021
Copy link
Contributor

@annieyw annieyw left a 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

@jelbourn
Copy link
Member

jelbourn commented Mar 3, 2021

@mmalerba what does mdc itself do w/ icon-button inside a prefix/suffix?

@mmalerba
Copy link
Contributor Author

mmalerba commented Mar 3, 2021

@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

@mmalerba mmalerba force-pushed the mdc-ff-suffix branch 3 times, most recently from 4deb876 to cbcc80c Compare March 4, 2021 22:53
@mmalerba
Copy link
Contributor Author

mmalerba commented Mar 4, 2021

addressed the feedback and cleaned things up with comments/variables. also updated the demo, PTAL

@mmalerba mmalerba added G This is is related to a Google internal issue P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release labels Mar 5, 2021
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement G This is is related to a Google internal issue P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants