primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Autocomplete: emptyMessage is not showed, when no item fit condition

Open kkoripl opened this issue 2 years ago • 2 comments

Describe the bug

When entering value that can't be auto completed due to lack of items fitting given condition, there is an empty html list shown.

emptydropdown-without-fix

Environment

Windows 10 Primeng: v16.9.2-lts + Angular: v16.2.12 - reproduced at Primeng: v17.5.0 + Angular: v17.0.5

Reproducer

https://primeng.org/autocomplete

Angular version

16.2.12

PrimeNG version

16.9.2-lts

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.6.0+

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to https://primeng.org/autocomplete
  2. Pick autocomplete, that have static items list - like countries at 'Reactive Forms' paragraph.
  3. Type something that won't fit any country, like 'notexisting'
  4. Empty list will be shown.

Expected behavior

There is no empty list shown - there is just input.

kkoripl avatar Feb 07 '24 10:02 kkoripl

agreed. Also found an issue with double form update on item select (not always). Check console logs here https://stackblitz.com/edit/zcpssv?file=src%2Fapp%2Fdemo%2Fautocomplete-reactive-forms-demo.html

@mehmetcetin01140 ^

volkorros avatar Feb 10 '24 12:02 volkorros

Hi,

Expected behavior is when the search value does not exist in the options, an empty message should be displayed. Your example works with using [showEmptyMessage]= "true". I'll make it true by default to avoid misunderstandings such as this issue.

cetincakiroglu avatar Feb 13 '24 12:02 cetincakiroglu