Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown selecting an unwanted option when pressing Windows key on the keyboard #10113

Closed
qbek15 opened this issue Apr 14, 2021 · 0 comments
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@qbek15
Copy link

qbek15 commented Apr 14, 2021

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

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

  1. Set focus on the dropdown (e.g. by choosing some option from the list);
  2. Without losing focus from the dropdown, press the Windows key on the keyboard;
  3. Option that contained a 'meta...' label becomes selected;

PXhSCrxWhr

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

@yigitfindikli yigitfindikli self-assigned this Apr 14, 2021
@yigitfindikli yigitfindikli added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Apr 14, 2021
@yigitfindikli yigitfindikli added this to the 11.4.0 milestone Apr 14, 2021
@yigitfindikli yigitfindikli added the LTS-PORTABLE Issue's fix will be ported to supported LTS versions label Apr 15, 2021
@yigitfindikli yigitfindikli added LTS-FIXED-10.1.2 and removed LTS-PORTABLE Issue's fix will be ported to supported LTS versions labels May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants