primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.56k stars 4.61k forks source link

Component: MultiSelect autoOptionFocus=true #16728

Open rgolonko opened 4 days ago

rgolonko commented 4 days ago

Describe the bug

First value on sugesttion (after typing some sign in inputFilter and narrow list) is not in focused so confirming value by clicking "Enter" is not possible.

Environment

Windows, Chrome

Reproducer

No response

Angular version

18.2.8

PrimeNG version

17.18.11

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

22.4.0

Browser(s)

Chrome 130

Steps to reproduce the behavior

  1. Go to: https://primeng.org/multiselect#filter
  2. Use inputFilter field ex. type "Ro"
  3. First value on suggestions is "Rome" but is not focuese and confirming value by enter is not possible

Expected behavior

First value on suggestions should be focued if autoOptionFocus is set to true.

rgolonko commented 4 days ago

For workaround I've used @ViewChild('ms') multiselect: MultiSelect; and in callback onFilter() calling this.multiselect.focusedOptionIndex.set(this.multiselect.findFirstOptionIndex()) will do the job :)