Drodown: Unable to type spaces in editable dropdowns #14377
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
Starting in PrimeNG 16.7.0, users cannot type spaces into an editable dropdown.
Pressing the space bar attempts to "complete" the dropdown rather than adding a space character.
It works in PrimeNG v16.6.0: https://stackblitz.com/edit/stackblitz-starters-nu65c1?file=src%2Fmain.ts
Broken in PrimeNG v16.7.0: https://stackblitz.com/edit/stackblitz-starters-rk61av?file=src%2Fmain.ts
The culprit seems to be this bit of code:
The
onSpaceKey
method executes theonEnterKey
method if the space key is not pressed inside of the input. That makes sense. This would allow users to press the space key normally while inside the input. However, no value is ever passed into thepressedInInputText
parameter, so it will always befalse
, thus never letting users type a space.Current workaround: Disable the
onSpaceKey
method in any component that uses an editable Dropdown:Environment
Stackblitz
Reproducer
https://stackblitz.com/edit/stackblitz-starters-rk61av?file=package.json,src%2Fmain.ts
Angular version
16.2.12
PrimeNG version
16.7.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
Whichever version Stackblitz uses
Browser(s)
No response
Steps to reproduce the behavior
[editable]="true"
Expected behavior
Users should be able to type spaces into editable dropdowns.
The text was updated successfully, but these errors were encountered: