primefaces / primefaces/primereact
ListBox: metaKeySelection={true} doesn't work
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
In the lastest version (10.5.1) the metaKeySelection default type is changed as false in some component (see https://github.com/primefaces/primereact/issues/5956).
However, in the ListBox component, the attribut metaKeySelection (set as true) doesn't work anymore. We can select multiple element from the list with simple clicks, without pressing any metakeys.
Reproducer
No response
PrimeReact version
10.5.1
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
Create a standard ListBox component with the attribut "multiple" and "metaKeySelection={true}"
https://stackblitz.com/edit/nqeuji?file=src%2FApp.jsx
Expected behavior
When I set the attributs multiple and metaKeySelection={true} clicking on an element, without pressing a metakey, replace the previous selection. My chosen element is not add to the selection but become the only one element selected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ListBox component and reproduce the behavior using the linked StackBlitz example with multiple and metaKeySelection={true}. Verify the selection logic for clicks with and without a metakey, and consider the issue done when an unmodified click replaces the previous selection while metakey clicks preserve multiple selections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100