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

Component: Autocomplete with updateOn blur #16805

Closed
SpeederX opened this issue Nov 21, 2024 · 1 comment · Fixed by #16828
Closed

Component: Autocomplete with updateOn blur #16805

SpeederX opened this issue Nov 21, 2024 · 1 comment · Fixed by #16828
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@SpeederX
Copy link
Contributor

SpeederX commented Nov 21, 2024

Describe the bug

When you setup the autocomplete with the updateOn: "blur" as value change event of the FormControl, the input will be updated only after the first selection happens, but the value will always have the last selected value by the user.
Due to how the event of blur is handled in the , this doesn't make it consistent with the logic.

The stackblitz is the one on the example page with virtual scroll, so I forked that one.

I add an additional comment as we found this bug during an integration of the component into our existing webapp. If you're ok with it I can provide already some insight on how we handled it and I think might work out to solve this kind of behavior. Are open contribution doable via fork + pr? ( new here )

Environment

Windows, Chrome

Reproducer

https://stackblitz.com/edit/fysj2c?file=src%2Fapp%2Fautocomplete-virtual-scroll-demo.html

Angular version

17.3.8-11

PrimeNG version

17.18.11-2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.11.0

Browser(s)

Chrome 131

Steps to reproduce the behavior

  1. Click on the input of the autocomplete
  2. Select one option
  3. Suggestions will close and once again, click on the input of the autocomplete
  4. Select one option

Expected behavior

When a user Select the option, the autocomplete should set the value to the form accordingly

@SpeederX SpeederX added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 21, 2024
@mertsincan mertsincan added Resolution: Help Wanted Issue or pull request requires extra help and feedback and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 22, 2024
@mertsincan mertsincan added this to the Future milestone Nov 22, 2024
Copy link

Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨

SpeederX added a commit to SpeederX/primeng that referenced this issue Nov 24, 2024
@mertsincan mertsincan added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Resolution: Help Wanted Issue or pull request requires extra help and feedback labels Dec 6, 2024
@mertsincan mertsincan modified the milestones: Future, 17.18.13 Dec 6, 2024
@mertsincan mertsincan linked a pull request Dec 6, 2024 that will close this issue
@mertsincan mertsincan moved this to Review in PrimeNG Dec 7, 2024
@mertsincan mertsincan moved this from Review to Done in PrimeNG Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants