Replies: 2 comments
-
Any updates on this issue? When you delete a Chip, it should not be removed until the user confirms. It's too easy to click on the remove icon by mistake. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I am using the remove callback, but the Chip is removed even if the user clicks on cancel for the confirmation. As soon as the user clicks on the remove icon, the Chip is removed and the Confirm Dialog box is then presented. The Chip should not be removed until the user chooses to remove it, and if they cancel, the Chip should remain. The following is my code:
Confirmation:
Any thoughts? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
It is challenging to use the Chip removable option because we have no control over the effective removal of the Chip. @remove allows us to specify a callback, but in any case, the Chip will disappear, even in undesirable situations (such as an error during the deletion of the data associated with this Chip).
It is possible to gain control over the delete button's behavior, but to achieve this, it is necessary to completely redefine the style of this button using the removeicon slot. Overriding is not desirable because we lose the default functionality coded into this slot and any upcoming features in future primevue versions.
Here is an example case on StackBlitz demonstrating chips that would not be removed with the consideration of this evolution:
https://stackblitz.com/edit/vitejs-vite-s8tgqd?file=src%2Fcomponents%2FTestChipRemove.vue
Another solution could be adding a "noAutoRemove" attribute to a removable chip, indicating that the Chip will not be made invisible automatically; it's the @remove callback that must necessarily handle hiding it.
Thx for your great work !
Beta Was this translation helpful? Give feedback.
All reactions