在Angular中的ng-select下拉菜单中选择一个选项后,如何删除闪烁的光标?

时间:2018-07-24 10:46:06

标签: angular npm cursor dropdown angular-ngselect

我正在使用Angular 5中的ng-select进行下拉。选择一个选项后,闪烁的光标应消失或它的位置应在文本的末尾。但是从下拉菜单中选择任何选项后,闪烁的光标将移至文本的开始位置。我该如何解决这个问题?

2 个答案:

答案 0 :(得分:2)

I mean it's not an issue but it's a feature of ng-select,

as it by default lets you to search or enables you the autocomplete functionality,

to stop this or to hide the autocomplete functionality you need to pass one extra attribute called

[searchable]="false"

this will disable the cursor and autocomplete functionality will also not work hope this helps you

here is the plunkr also here is the full documentation for the same

答案 1 :(得分:0)

在CSS中使用以下代码

    return data.map((item: IChartData, index: number, array:IChartData[] ) => {
    if (index === 0 || index === array.length - 1) {
      return {...item , color:'#137cbd'}
    }
    // ...