Skip to content

Autocomplete v21.0.2 with ForceSelection does not work with minQueryLength #19218

@eduardheller

Description

@eduardheller

Describe the bug

Due to the newly changes on the autocomplete I create a PR https://github.com/primefaces/primeng/pull/18593 which got merged. But the forceSelection now is buggy when minQueryLength is given. I made a mistake by thinking that hide() is the right place to check for inputChange on ForceSelection. But hide get called everytime something prevents it from showing like minQueryLength, which now caused an immediate clear.

I submitted a PR.

Pull Request Link

#19219

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/qmxqgeee-adfsijon?file=src%2Fapp%2Fforce-selection-demo.html,src%2Findex.html,src%2Fapp%2Fforce-selection-demo.ts,src%2Fapp%2Fforce-selection.scss,angular.json,src%2Fstyles.scss,src%2Fmain.ts,src%2Fapp%2Fcountryservice.ts

Environment

PrimeNG 21.0.2

Angular version

21

PrimeNG version

v21

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Click on Autocomplete with ForceSelection and minQueryLength > 1
  2. Write something
  3. Input gets cleared without blurring out

Expected behavior

  1. Click on Autocomplete with ForceSelection and minQueryLength > 1
  2. Write something
  3. Input gets not removed

Metadata

Metadata

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions