primevue icon indicating copy to clipboard operation
primevue copied to clipboard

AutoComplete: chip slot only text, token passthrough has no context

Open quantumwebco opened this issue 9 months ago • 1 comments

Describe the bug

I am trying to add a custom click handler to the chips of an AutoComplete with multiple selections

In the autocomplete component the slop for the chip is only for the chip text

image

This means it is not possible to create a custom chip template, only to change the text, which means I can only add a click handler to the text part not the whole chip

For some reason in passthrough it is not called chip, it is called token, but I am able to add a click handler

However, the click handler does not have the context of the "token" clicked on, only the context of the AutoComplete

image

I can't find any information on the "token" that was just clicked in the callback

image

Reproducer

https://stackblitz.com/edit/primevue-create-vue-issue-template-bo1fwt?file=src%2FApp.vue

PrimeVue version

3.52

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

As above

Expected behavior

Should be able to override the whole chip or pass the token click event through the callback

quantumwebco avatar May 10 '24 09:05 quantumwebco

I did find a workaround by using an absolute positioned div as the background

image

quantumwebco avatar May 10 '24 09:05 quantumwebco