primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.98k stars 1.06k forks source link

Chips: Prevent chip delete with backspace when removable is a function #6427

Closed guilhermekf closed 7 months ago

guilhermekf commented 7 months ago

Describe the bug

Right now if I am using removable as false and I try to hit backspace it prevent the deletion of the chips, My problem is that if I am using a function to define which chips are removable I can delete all of them with the backspace

Reproducer

https://stackblitz.com/edit/ai1xhn?file=src%2FApp.jsx

PrimeReact version

10.6.3

React version

17.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

Chips should not be deleted with backspace if am using the function in the removable

melloware commented 7 months ago

Yep the BackSpace key probably need to check the removable function.

melloware commented 7 months ago

PR submitted.