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

p-autocomplete completeMethod ignores minLength #14938

Closed
rennechSICKAG opened this issue Mar 4, 2024 · 2 comments
Closed

p-autocomplete completeMethod ignores minLength #14938

rennechSICKAG opened this issue Mar 4, 2024 · 2 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@rennechSICKAG
Copy link

rennechSICKAG commented Mar 4, 2024

Describe the bug

The primeng p-autocomplete component ignores the minLength when clicking the dropdown icon. The completeMethod event is fired anyway.
In the documentation is written for the MinLength: Minimum number of characters to initiate a search.
On clicking the Dropdown-Icon when the min length is not reached the completeMethod event is fired and the search will run anyway.

Environment

Angular

Reproducer

No response

Angular version

17.1.1

PrimeNG version

17.5.0

Build / Runtime

TypeScript

Language

TypeScript

Node version (for AoT issues node --version)

18

Browser(s)

Firefox & Chrome

Steps to reproduce the behavior

  1. Go to the Documentation: https://primeng.org/autocomplete#dropdown
  2. Click Edit With StackBlitz
  3. Add a [minLength]="x" to the component
  4. Click the search icon

Expected behavior

The search-event is not fired, because the min Length is not reached

@rennechSICKAG rennechSICKAG added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 4, 2024
@mehmetcetin01140
Copy link
Contributor

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding!
Best Regards,

@mbortoli
Copy link

mbortoli commented Dec 24, 2024

Still present as of version 17.18.15, but not sure it’s a bug, though.

I believe it breaks because the “search” function only checks the query length if the event source is an “input”.

Is this the expected behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

3 participants