我使用ng2-auto-complete来获得Angular2(版本2.3.1)和Angular Material(版本2.0.0-beta.1)的可搜索下拉列表 .

我面临着与所选值的占位符覆盖问题 . 当我从下拉列表中选择任何值而不键入搜索字符串时,所选值将覆盖该输入字段的html占位符 .

当我们将字符串搜索到下拉列表然后选择它时,它工作正常 .

以下是我的代码示例:

<input md-input ng2-auto-complete
           [formControl]="company"
           [source]="clients"
           [list-formatter]="companyFormatter"
           align="end"
           value-property-name="shortname"
           display-property-name="shortname"
           no-match-found-text="No Match Found"
           placeholder="Client Name"
           (valueChanged)="someFunction(company)"
           class="form-control"
           tabindex="1">

哪里,

clients = ["{shortname:abc},{shortname:efg},{shortname:hij}"]

任何See Image Here. The view looks like this and thats not good for user.