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

Form field icon button prefix or suffix is too small #10313

Closed
gtranter opened this issue Mar 7, 2018 · 7 comments
Closed

Form field icon button prefix or suffix is too small #10313

gtranter opened this issue Mar 7, 2018 · 7 comments
Assignees
Labels
P4 A relatively minor issue that is not relevant to core functions

Comments

@gtranter
Copy link

gtranter commented Mar 7, 2018

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Icons and icon-buttons used as form field prefix or suffix have the same appearance (size, alignment ...).

What is the current behavior?

When a mat-icon-button is used as a prefix or suffix, it is smaller than just an icon.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-hlm3xm-9b6hqp

What is the use-case or motivation for changing an existing behavior?

Doesn't look good especially when both are used at the same time (e.g. an icon prefix with an icon-button suffix) and doesn't comply with material design guidelines https://material.io/guidelines/components/text-fields.html#field-variations-figure-caption-2.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

beta 6

Is there anything else we should know?

This appears to be due to style font size inheritance.

@josephperrott josephperrott added the P4 A relatively minor issue that is not relevant to core functions label Mar 26, 2018
@mmalerba
Copy link
Contributor

This is probably not something we will change in the legacy style form-fields but the icon is the same size in the other styles, i.e. any of the following:

<mat-form-field appearance="standard">...</mat-form-field>
<mat-form-field appearance="outline">...</mat-form-field>
<mat-form-field appearance="fill">...</mat-form-field>

@gtranter
Copy link
Author

@mmalerba Can I know why not? Is there some technical reason or Material Design rule?

@mmalerba
Copy link
Contributor

The full size icon button doesn't really fit in the legacy style form-field. The standard style is more or less an updated version of the legacy style as the spec has evolved. Some of the changes would have been too drastic to apply to everyone's existing form fields so it's opt-in for now by allowing the user to choose if they want the legacy or standard style. We will eventually remove the legacy style completely.

If you want to opt all of your form-fields into the new style without adding appearance="standard" to all of them, you can provide a default using MAT_FORM_FIELD_DEFAULT_OPTIONS: https://github.com/angular/material2/blob/master/src/lib/form-field/form-field.ts#L76

@gtranter
Copy link
Author

@mmalerba I'm using a full size icon button in a material 5.2.x form-field right now and it fits fine - I've had to make style adjustments of course to work around the existing problems. Stackblitz:.

Is the "legacy" style being dropped from the Material Design specifications as well?

@mmalerba
Copy link
Contributor

The spec doesn't distinguish between the two, "legacy" and "standard" both refer to the normal underline style which is in the spec. We just made the distinction to allow us to make changes bringing our implementation closer to what's in the spec without breaking people's layouts.

@gtranter
Copy link
Author

@mmalerba Ah - I see now. Thanks.

@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 Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

3 participants