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(form-field): multiple projected block-level prefix/suffix stacking on top of each other #14317

Closed

Conversation

crisbeto
Copy link
Member

Fixes multiple block elements that are projected inside a prefix or a suffix stacking on top of each other, rather than going sideways.

…g on top of each other

Fixes multiple block elements that are projected inside a prefix or a suffix stacking on top of each other, rather than going sideways.
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Nov 28, 2018
@crisbeto crisbeto requested a review from mmalerba as a code owner November 28, 2018 21:29
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 28, 2018
@@ -45,6 +45,9 @@ $mat-form-field-default-infix-width: 180px !default;
white-space: nowrap;
flex: none;
position: relative;

// Allow for projected block-level elements not stand next to each other, rather than stack.
display: flex;
Copy link
Member Author

Choose a reason for hiding this comment

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

@mmalerba as far as I could tell there shouldn't be any visual differences, but you might have some more insights.

@TFleury
Copy link

TFleury commented Dec 3, 2018

We also need to fix alignments with :

.mat-form-field-flex {
  align-items: center;
}

.mat-form-field-prefix,
.mat-form-field-suffix {
  display: flex;
  align-items: center;
}

With this, mat-icon and mat-icon-button are vertically aligned (all browsers)
And it also fixes the strange behavior of Edge/IE with mat-icon-button and mat-datepicker-toggle.(#11650, #13094, #13322 & #13592)

@mmalerba
Copy link
Contributor

mmalerba commented Dec 3, 2018

@TFleury applying those styles seems to cause misalignment of the prefix and suffix in the legacy form field.

I'm fine with this change, but I never really intended for people to use multiple prefix/suffix. If people want to do something like that they can make a single prefix/suffix which is a wrapper div and aligns its children however they want

@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Dec 3, 2018
@TFleury
Copy link

TFleury commented Dec 3, 2018

@mmalerba I pushed another PR (#14369) with scoped style changes.

@mmalerba
Copy link
Contributor

mmalerba commented Dec 4, 2018

It looks like this does actually cause some slight alignment changes in people's apps. I think I'd rather not make this change and instead encourage people to only use a single matPrefix / matSuffix (even if that single element is a wrapper containing several sub-elements).

@mmalerba mmalerba removed pr: lgtm action: merge The PR is ready for merge by the caretaker labels Dec 4, 2018
@crisbeto
Copy link
Member Author

crisbeto commented Dec 4, 2018

Makes sense. Closing since it seems like a high risk change for a rare case that shouldn't really be supported.

@crisbeto crisbeto closed this Dec 4, 2018
@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 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants