Material: radio-group: formatting issue when inside md-input-container with label

Created on 19 Nov 2015  路  8Comments  路  Source: angular/material

When wrapping a md-radio-group inside an md-input-container with a label, the label overlaps the first radio button. This should format similarly to other input types in order provide consistent formatting over a form

Here's a codepen to illustrate the problem: http://codepen.io/anon/pen/QjoYKE

minor won't fix enhancement

Most helpful comment

You might also want to add the md-input-invalid class manually to get errors shown in the container...

<md-input-container class="md-input-has-value"
          ng-class="{ 'md-input-invalid' : form.x.$invalid && form.$submitted }">
...

Example: https://codepen.io/jakobadam/pen/xqZoBR

All 8 comments

Update: Explicitly adding class="md-input-has-value" to the md-input-container wrapping the md-radio-group improves the formatting significantly by showing the smaller label.

I see that the documentation for md-input-container only states it is to be used with input and textarea elements, but it does also work with md-select. It would be nice to be able to use labels and md-input-container for all form elements in order to provide consistent formatting of a form.

For a form element such as md-radio-group it doesn't make sense to have the label change sizes depending on whether or not it has a value. Perhaps the md-input-container directive should automatically style it's labels with the smaller format if the form element it contains is checkboxes or radios.

+1 just came across this

+1 also ran into this issue.

+1

+1

This issue is closed as part of our 鈥楽urge Focus on Material 2' efforts.
For details, see our forum posting @ http://bit.ly/1UhZyWs.

+1 Definitely was a tricky one, adding class="md-input-has-value" as recommended made a significant improvement

You might also want to add the md-input-invalid class manually to get errors shown in the container...

<md-input-container class="md-input-has-value"
          ng-class="{ 'md-input-invalid' : form.x.$invalid && form.$submitted }">
...

Example: https://codepen.io/jakobadam/pen/xqZoBR

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

epelc picture epelc  路  3Comments

bobber205 picture bobber205  路  3Comments

WebTechnolog picture WebTechnolog  路  3Comments

kasajian picture kasajian  路  3Comments