angular2-mdl-ext icon indicating copy to clipboard operation
angular2-mdl-ext copied to clipboard

Floating label on select is not working

Open kleber-swf opened this issue 8 years ago • 4 comments

Maybe I'm doing something wrong, but this piece of code is not showing the floating label:

<mdl-select label="Unity" floating-label name="unity" [(ngModel)]="item.unity">
    <mdl-option *ngFor="let u of item.unities" [value]="u.id">{{u.name}}</mdl-option>
</mdl-select>

To make the floating label appear I have to put the placeholder and the class manually, like this:

<mdl-select label="Unity" placeholder="Unity" floating-label name="unity" class="mdl-textfield--floating-label" [(ngModel)]="item.unity">
    <mdl-option *ngFor="let u of item.unities" [value]="u.id">{{u.name}}</mdl-option>
</mdl-select>

Is that right? Am I missing something?

Thanks for the awesome component, btw 😃

kleber-swf avatar Jun 05 '17 13:06 kleber-swf

I met the same issue.

Pomelool avatar Jul 17 '17 15:07 Pomelool

Yep. Two months and I'm having the same problem too, hahha. I'm using the workaround since then.

kleber-swf avatar Jul 17 '17 23:07 kleber-swf

Hmm it seems to work for me. Do you guys see same issue here: http://mseemann.io/angular2-mdl-ext/select in example select provided by ngModel with floating label section?

adasq avatar Sep 29 '17 08:09 adasq

Also not working for me. What's strange is that it worked fine then after modifying the template it stopped and I'm not sure at what point.

FYI, partial package list and versions below:

"@angular-mdl/core": "^4.0.8",
"@angular-mdl/popover": "^0.8.0",
"@angular-mdl/select": "^0.11.2",
"@angular/animations": "~4.4.4",
"@angular/common": "~4.4.4",
"@angular/compiler": "~4.4.4",
"@angular/core": "~4.4.4",
"@angular/flex-layout": "^2.0.0-beta.9",
"@angular/forms": "~4.4.4",
"@angular/http": "~4.4.4",
"@angular/platform-browser": "~4.4.4",
"@angular/platform-browser-dynamic": "~4.4.4",
"@angular/platform-server": "~4.4.4",
"@angular/router": "~4.4.4",
"@angularclass/hmr": "~2.1.3",
"@angularclass/hmr-loader": "^3.0.4",
"@angular/compiler-cli": "~4.4.4",

samdbrice avatar Oct 15 '17 17:10 samdbrice