Skip to content
This repository has been archived by the owner on Jun 16, 2019. It is now read-only.

Floating label on select is not working #833

Open
kleber-swf opened this issue Jun 5, 2017 · 4 comments
Open

Floating label on select is not working #833

kleber-swf opened this issue Jun 5, 2017 · 4 comments

Comments

@kleber-swf
Copy link

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 😃

@Pomelool
Copy link

I met the same issue.

@kleber-swf
Copy link
Author

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

@adasq
Copy link
Contributor

adasq commented Sep 29, 2017

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?

@samdbrice
Copy link

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",

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants