primefaces / primefaces/primereact

MultiSelect: Uncaught ReferenceError: filter is not defined

Open
#8,376 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Triage
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

When we open the MultiSelect and press Tab key there is an error in console Uncaught ReferenceError: filter is not defined.
It comes from the https://github.com/primefaces/primereact/blob/prod/components/lib/multiselect/MultiSelect.js line 280 hide(filter)
Filter variable is undefined and also hide function doesn't take any parameters (line 534)
It casues the issue that MultiSelect dropdown is not closed after tabbing to the next form element from it.
After removing locally filter parameter from the line 280, everything works fine.

Reproducer

No response

System Information
System:
    OS: Windows 11 10.0.26100
    CPU: (6) x64 Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz
    Memory: 10.79 GB / 31.87 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\NodeJS 20.10.0\node.EXE
    npm: 10.2.3 - C:\Program Files\NodeJS 20.10.0\npm.CMD
  Browsers:
    Chrome: 141.0.7390.123
    Edge: Chromium (141.0.3537.71)
    Firefox: 143.0.1 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    primereact: ^10.9.6 => 10.9.6 
    react: 19.1.0 => 19.1.0
Steps to reproduce the behavior
  1. Open MultiSelect dropdown
  2. Mark some option for example with with arrows and space
  3. Press Tab
Expected behavior

No errors, MultiSelect dropdown is closed after pressing Tab

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in components/lib/multiselect/MultiSelect.js around line 280 and inspect the hide function near line 534. Reproduce the Tab-key flow described in the issue, then verify that it closes the dropdown without a console error and does not regress option selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.