I'm submitting a bug
[ x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
This behavior was working as expected in version 4.1.2 since 4.2.0 (i dont know the exact version when it stopped showing list of suggestions);
Current behavior
When input has focus(don't typing any character inside input field), list of items don't show
Expected behavior
List of suggestions should show on focus.
This just started happening in our app as well.
Same as #3929
http://plnkr.co/edit/rpglosr2anlJkV4cdsrS?p=preview
Why should they show up on focus anyway without no typing?
List of suggestions should show on focus.
+100
@cagataycivici in our case we preload some values when loading the view, so if you focus you already see a list of suggestions available but we can return more values if you start typing. It is just to make the user life easier.
So there is no way with the current release to make that?
I am using the folllowing workaround to display the selection on focus when there is no value selected:
<p-autoComplete ... (onFocus)="!autocomplete.value && autocomplete.handleDropdownClick()" dropdownMode="current" #autocomplete>
</p-autoComplete>
@cagataycivici From the user perspective I believe this behavior is useful for previewing what kind of data can be queried and returned, and also for immediate feedback that specific field has a different behavior and it is not a generic text input where it can enter any value.
Hi, This solved for me
<p-autoComplete ... (onFocus)="autocomplete.show()">
</p-autoComplete>
Still looking forward any updates on this issue.
As @dinhani described, the workaround works on the first click on the input field. Once the selected item is cleared, this method will be no more valid. Here is my workaround to display the list also after clearing the selected item:
<p-autoComplete ...
(onFocus)="!autocomplete.value && autocomplete.handleDropdownClick()"
(onClear)="clearItem(autocomplete)" #autocomplete>
</p-autoComplete>
then implement the function clearItem() in component:
clearItem(autocomplete: any) {
autocomplete.value = '';
autocomplete.handleDropdownClick();
}
Will add showOnFocus targeting 9.0.2
Added "completeOnFocus" property, defaults to false.
Most helpful comment
I am using the folllowing workaround to display the selection on focus when there is no value selected: