creativetimofficial / material-dashboard-angular2

Material Dashboard Angular
https://demos.creative-tim.com/material-dashboard-angular2/
MIT License
1.01k stars 2.09k forks source link

Floating Label is broken with default value #15

Closed ghost closed 7 years ago

ghost commented 7 years ago

image

<div class="form-group label-floating">
        <label class="control-label">Description</label>
        <input type="text" class="form-control" [value]="item.description">
</div>

This issue occurs when I use angular 4 binding. Thanks

alexandru-paduraru commented 7 years ago

@gogo217 thank you for using our product. Please check the solution that we have here: https://github.com/creativetimofficial/material-dashboard-pro/issues/50 Basically you need to manually remove the is-empty class from the parent of the input. We will have a fix for this soon.

Best, Alex

ghost commented 7 years ago

Thanks, but below code snippet would also be helpful.

$.material.options.autofill = true;
$.material.init();
aomegax commented 7 years ago

Hi, @gogo217. Your workaround works only if there are only one or more inputs, not to textarea