我在我的 ember 应用程序中使用 mdb。我正在为输入字段生成动态值。在 UI 中,值和标签重叠。如何处理?
<div class="md-form">
<i class="fa fa-user-o prefix grey-text iconSize"></i>
{{input type="text" id="firstName" class="form-control" value=model.firstName}}
<label for="firstName">First Name<i class="mandatoryIcon">*</i></label>
</div>
最佳答案
试试这个:
didInsertElement() {
this._super(...arguments);
if (this.get('model.firstName') !== null) {
Ember.$('firstName').focus();
}
}
您也可以随时使用自动对焦属性
{{input type="text" id="firstName" class="form-control" value=model.firstName autofocus=true}}
关于javascript - 使用 Bootstrap 在 Material 设计中重叠标签和值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46747758/