【发布时间】:2019-02-22 22:28:17
【问题描述】:
我们的项目有以下情况
isSearchFocused ? 'Type two or more characters' : 'Search markets'
在html中
<input class="market-search__search-input"
type="text"
#marketSearchInput
(click)="handleSearchClick()"
placeholder="{{ isSearchFocused ? 'Type two or more characters' : 'Search markets' }}"
formControlName="query">
方法'handleSearchClick'
handleSearchClick() {
this.isSearchFocused = true;
this.marketSearchInput.nativeElement.focus();
if (!this.active) {
this.openModal();
}
}
当值“isSearchFocused”通过事件单击从“false”更改为“true”时 - 在除 IE 11 之外的所有浏览器中都可以正常工作。在 IE 11 中,输入消失焦点时文本会发生变化。 有什么想法吗?
【问题讨论】:
-
试试[占位符]
-
一切正常
标签: angular internet-explorer-11