@@ -4,6 +4,7 @@ $input-label-default-offset: 24px !default;
44$input-label-default-scale : 1.0 !default ;
55$input-label-float-offset : 6px !default ;
66$input-label-float-scale : 0.75 !default ;
7+ $input-label-float-width : $input-container-padding + 16px ;
78
89$input-placeholder-offset : $input-label-default-offset !default ;
910
@@ -100,11 +101,28 @@ md-input-container {
100101 > label {
101102 @include rtl (left , $icon-offset , auto );
102103 @include rtl (right , auto , $icon-offset );
104+
105+ & :not (.md-no-float ):not (.md-container-ignore ),
106+ .md-placeholder {
107+ width : calc (100% - #{$icon-offset } - #{$input-label-float-width } );
108+ }
109+ }
110+
111+ & .md-input-focused ,
112+ & .md-input-has-placeholder ,
113+ & .md-input-has-value {
114+ label :not (.md-no-float ) {
115+ width : calc ((100% - #{$icon-offset } - #{$input-label-float-width } ) / #{$input-label-float-scale } );
116+ }
103117 }
104118 }
105119
106120 label :not (.md-no-float ):not (.md-container-ignore ),
107121 .md-placeholder {
122+ overflow : hidden ;
123+ text-overflow : ellipsis ;
124+ white-space : nowrap ;
125+ width : 100% ;
108126 order : 1 ;
109127 pointer-events : none ;
110128 -webkit-font-smoothing : antialiased ;
@@ -272,6 +290,9 @@ md-input-container {
272290 & .md-input-has-value {
273291 label :not (.md-no-float ) {
274292 transform : translate3d (0 , $input-label-float-offset , 0 ) scale ($input-label-float-scale );
293+ transition : transform $swift-ease-out-timing-function 0.5s ,
294+ width $swift-ease-out-timing-function 0.5s ;
295+ width : calc ((100% - #{$input-label-float-width } )/ #{$input-label-float-scale } );
275296 }
276297 }
277298
@@ -317,16 +338,6 @@ md-input-container.md-icon-float {
317338 @include rtl (left , 2px , auto );
318339 @include rtl (right , auto , 2px );
319340 }
320-
321- & .md-input-focused ,
322- & .md-input-has-value {
323-
324- label {
325- transform : translate3d (0 , $input-label-float-offset , 0 ) scale ($input-label-float-scale );
326- transition : transform $swift-ease-out-timing-function 0.5s ;
327- }
328- }
329-
330341}
331342
332343md-input-container .md-icon-right {
0 commit comments