Dropdown selecting an unwanted option when pressing Windows key on the keyboard #10113
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
https://stackblitz.com/edit/github-1zvqmt?file=src%2Fapp%2Fapp.component.html
Current behavior
It seems that there is a problem with the
<p-dropdown>
component when the options collection contains an object with label value that starts with chars 'meta' (the option value can be any string).E.g.:
{ label: 'meta', value: 'someVal'}
or{ label: 'Metastasis', value: 'someVal2'}
but
{ label: 'met', value: 'someVal'}
doesn't cause the problem so, it is only caused by a label that starts with 'meta...', 'Meta...', 'META...', 'mEtA...' etc.
If there is such option in the dropdown options, and user presses the
Windows key
on the keyboard when the<p-dropdown>
is focused then that 'meta...' option becomes selected although user didn't want it.Expected behavior
Dropdown doesn't select any option when the Window key is pressed.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
The problem occurs on a medical app. There is a dropdown option 'Metastasis' which is a medical term and accidental selection of an unwanted option by pressing the Win key is very highly unwelcome.
Please tell us about your environment:
Windows 10 Home
Angular version: 9.X
9.0.7 but also on the 11.0.4 available in the Stackblitz sample.
PrimeNG version: 9.X
9.1.3 but also on the 11.3.0 available in the Stackblitz sample.
Browser: [ Chrome XX | Edge | Electron ]
What's interesting, the issue doesn't occur on Firefox 87.0!
Language: [all | TypeScript X.X | ES6/7 | ES5]
Node (for AoT issues):
node --version
=probably irrelevant
The text was updated successfully, but these errors were encountered: