Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
quantumwebco opened this issue May 10, 2024 · 1 comment
Open
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@quantumwebco
Copy link

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 quantumwebco added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 10, 2024
@quantumwebco
Copy link
Author

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

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant