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

AutoComplete: grouped options are not selected with enter key #12624

Closed
erikhorlings opened this issue Feb 13, 2023 · 2 comments · Fixed by #12628
Closed

AutoComplete: grouped options are not selected with enter key #12624

erikhorlings opened this issue Feb 13, 2023 · 2 comments · Fixed by #12628
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@erikhorlings
Copy link

Describe the bug

When selecting an option in an option group in p-utoComplete using the enter key, the selection is lost upon tabbing out of the field. This only occurs with Enter key and with forceSelection is true.

Environment

Angular 14.2.12, PrimeNg 14.2.2.

Reproducer

No response

Angular version

14.2.12

PrimeNG version

14.2.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v16.3.0

Browser(s)

No response

Steps to reproduce the behavior

Create a p-autoComplete with forceSelection is true and at least one grouped option. Navigate to that selection by using the arrow buttons and select it with the enter key. Press tab to move focus to another field. The selected value is now cleared.

Expected behavior

I expect the selected value to not be cleared.

@erikhorlings erikhorlings added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 13, 2023
@erikhorlings
Copy link
Author

erikhorlings commented Feb 13, 2023

The problem is in the method onInputChange of AutoComplete. I have a working implementation of that locally that proofs that it can made working by making this method deal with grouped options. I am willing to clean that implementation up and create a pull request for that, but that will take some time.

I have added a PR that solves the problem for me.

@perotorun
Copy link

Still not fixed in 15.4.2

@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 16, 2023
@cetincakiroglu cetincakiroglu added this to the 16.0.1 milestone Jun 16, 2023
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

Successfully merging a pull request may close this issue.

3 participants