How to limit selection via first letter of the option in mat select?

114 vaatamist
Liigu esimese lugemata sõnumi juurde

Manu Mohanan

lugemata,
15. veebr 2021, 14:26:5815.02.21
kuni angular-material2
Hi Everyone,

I have a mat-select select box which has options as below 

[{ label: Excellent, keyCode:A, id:1 }, { label:Very Good, keyCode:B, id:2 }, { label:Bad, keyCode:C id:3 }, ]

The selection of the options should be based on only the keyCode. The problem is that the interface seems to allow both the short cut key and the first letter of the option labels as short cut options. Currently, the selection is implemented by a function call onKeyPressed on (keydown) of the mat-select. Is there anything possible to stop the selection via the first letter of the option labels. Thanks in advance.

material version : @angular/material": "^9.2.4", angular : 9

Vasta kõigile
Vasta autorile
Saada edasi
0 uut sõnumit