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

click event conflict #148

Closed
manafn opened this issue Oct 2, 2021 · 3 comments
Closed

click event conflict #148

manafn opened this issue Oct 2, 2021 · 3 comments

Comments

@manafn
Copy link

manafn commented Oct 2, 2021

Hello , I used the multiselector inside tailwind ui modal (based on headless ui) , the problem is whenever I click on tag close icon it triggers modal close, how can I fix that ?

@erlendprikss
Copy link

Hello, I had same problem as you and my workaround for that was using tag slot:
<template v-slot:tag="{ option, disabled, handleTagRemove }"> <div class="multiselect-tag"> {{ option.whatever }} <slot name="tag" v-bind:option="option"></slot> <span v-if="!disabled" class="multiselect-tag-remove" @click="handleTagRemove(option, $event)"> <span class="multiselect-tag-remove-icon"></span> </span> </div> </template>
Important thing is to call handleTagRemove method on @click event (I guess this libary by default uses something else and conflicts with headless-ui)

Hope it helps :)

@adamberecz
Copy link
Collaborator

Thanks for reporting @manafn, it was indeed using mousedown events which I suppose was how it was left from a previous release probably without a good reason. Let's see how it works. Fixed in 2.3.0.

@stevebauman
Copy link

Excellent, I was also encountering this issue. Appreciate your work @adamberecz 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants