How to stop mat-autocomplete to take custom user input values apart from given options?

后端 未结 5 1292
你的背包
你的背包 2021-02-12 20:22

I am using mat-auto complete component from material.angular.io. The default behavior is user can input any value as well as it gives options to choose from. Also you can add yo

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-12 20:36

    The Material demo for chips autocomplete shows bindings on both the input and to the mat-autocomplete:

    
    
    

    If you only want to allow options from the autocomplete, just omit the add function from the input.

提交回复
热议问题