primefaces / primefaces/primereact

Chips: clearOnRejection option

Open
#3,152 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the feature you would like to see added

Currently, the Chips component clears the input every time the user attempts to add it.
This makes it hard to implement validation, for example when trying to restrict the chips to a list of (valid) email addresses.

Describe the solution you'd like

A clearOnRejection prop which, when set to false, would prevent the call to updateInput when allowAddition === false

Describe alternatives you have considered

A validate prop may be more generalisable

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 by locating the Chips component and tracing where input is cleared when allowAddition is false. Add the clearOnRejection behavior described in the issue, then verify that rejected input is retained when the option is false and existing clearing behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.