Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

text and md-input-container on the same row are not aligned #6214

Closed
uriva opened this issue Dec 10, 2015 · 43 comments
Closed

text and md-input-container on the same row are not aligned #6214

uriva opened this issue Dec 10, 2015 · 43 comments
Assignees
Labels
g3: reported The issue was reported by an internal or external product team. in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs P4: minor Minor issues. May not be fixed without community contributions. ui: CSS
Milestone

Comments

@uriva
Copy link

uriva commented Dec 10, 2015

codepen 1: http://codepen.io/anon/pen/yeNPgw
codepen 2: http://codepen.io/anon/pen/qbbaYX

@xplodwild
Copy link

+1
<div class="md-errors-spacer"></div>
This has been added recently and pad the fields of one line every input field. This causes the text to be misaligned, as well as make overly big forms spacing when not using validation and/or without errors.

@SnakeME
Copy link

SnakeME commented Dec 11, 2015

+1 please remove/hide md-errors-spacer when no errors are shown to make no overly big forms.

@JasperG
Copy link

JasperG commented Dec 12, 2015

was not being added when not using validation before.

@michaelkrog
Copy link

+1

1 similar comment
@gligoran
Copy link

+1

@julienpa
Copy link

+1, forms without ng-message are having unnecessary large spacings

@chrislambe
Copy link

+1

@vrosa
Copy link

vrosa commented Dec 16, 2015

On a related note, <div class="md-errors-spacer"></div> is only attached to containers with input fields but not with md-select. Ideally they should have the same behaviour.

@stewones
Copy link

+1

1 similar comment
@danielmana
Copy link

+1

@karsunke
Copy link

+1

@ThomasBurleson ThomasBurleson modified the milestones: 1.0.1, 1.0.2 Jan 5, 2016
@ThomasBurleson ThomasBurleson added in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs P4: minor Minor issues. May not be fixed without community contributions. and removed priority: high labels Jan 13, 2016
@cadilhac
Copy link

+1
Fix not seen in 1.0.2

@ThomasBurleson ThomasBurleson modified the milestones: 1.0.2, Backlog Jan 15, 2016
@mamluka
Copy link

mamluka commented Apr 10, 2016

+1

1 similar comment
@themaniac
Copy link

+1

@topherfangio topherfangio modified the milestones: 1.3.0, Backlog Apr 18, 2016
@hopeng
Copy link

hopeng commented Apr 19, 2016

+1

@ThomasBurleson ThomasBurleson modified the milestones: 1.3.0, Backlog, 1.1.0 Apr 20, 2016
@sweatherall
Copy link

+1

2 similar comments
@elekzalan
Copy link

+1

@idsulik
Copy link

idsulik commented May 2, 2016

+1

@bsandrow
Copy link

bsandrow commented May 3, 2016

To all the +1ers: It's possible the use the "Add Reaction" button to add a Thumbs Up / +1 to a comment. (like the "comment" that is the issue report, for example). I would like to be able to watch this issue for updates without a constant stream of "me too" posts.

This issue really comes down to the Angular Material team making a decision on error spacing and sticking to it. On the one hand people are complaining about "overly large" forms. On the other hand, when the error messages pop in you have form elements moving all over the place which is not very visually appealing either.

For example, I currently have a login form, where if you click a the "Reset Your Password" link, the loss of focus on the email field (the email field gets focus by default when the form launches) causes the error to pop in. Since the error space isn't statically reserved, the "Reset Your Password" link (which is under the form) is pushed down and (depending on where the mouse cursor is positioned) out of the way of the cursor. This leads to the click event never happening. Obviously there are ways for me to work around this, but I feel like I shouldn't have to work around this issue.

@tpphu
Copy link

tpphu commented May 19, 2016

+1

@ThomasBurleson ThomasBurleson modified the milestones: 1.1.0, Deprecated May 26, 2016
@ThomasBurleson
Copy link
Contributor

This issue is closed as part of our ‘Surge Focus on Material 2' efforts.
For details, see our forum posting.

@jeffklassen
Copy link

@ThomasBurleson So you're saying you're not going to fix this until the fall?

@Prozi
Copy link

Prozi commented Jul 11, 2016

css: .md-errors-spacer:empty { display: none; }

@danialkhansari
Copy link

display:none or height:0 are not good solutions since they hide error messages in all situations. What should I do if I want to disable it for my search input and leave it as is for registration form fields? We need a way to at least define custom css classes for this tag.

@durbonas
Copy link

create a class such as "hide-error-msg" and add it to your md-input-containers that have no error messages, like so:

<md-input-container class="hide-error-msg"> <label>Title</label> <input ng-model=""> </md-input-container>

Then ins CSS:

md-input-container.hide-error-msg .md-errors-spacer:empty { display: none; }

@topherfangio
Copy link
Contributor

@danialkhansari The display: none approach above should be just fine because it does not stop the errors from appearing. The spacer just provides a minimum height so that the messages do not jump/push content when they come into view.

We also have a PR in the works which will automatically detect if your input container has a messages directive and auto-apply the spacing properly. IIRC, this also gives you a way to manually add/remove the class so you have even more control, but it's been a while since I looked at it.

@egantz
Copy link

egantz commented Sep 20, 2016

+1
Did the min-height workaround though it is not ideal at all.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
g3: reported The issue was reported by an internal or external product team. in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs P4: minor Minor issues. May not be fixed without community contributions. ui: CSS
Projects
None yet
Development

No branches or pull requests