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

Clicking clear closes Headless UI modal #182

Closed
stevebauman opened this issue Dec 23, 2021 · 7 comments
Closed

Clicking clear closes Headless UI modal #182

stevebauman opened this issue Dec 23, 2021 · 7 comments

Comments

@stevebauman
Copy link

stevebauman commented Dec 23, 2021

Version

  • Vue version: 3

Description

Similarly to #148, when you click the clear (X) button inside the input element, it closes the headless UI modal.

I was able to resolve this using a @click handler instead of @mousedown, which triggers the modal to close:

<Multiselect>
    <template #clear="{ clear }">
        <span :class="classes.clear" @click="clear">
            <span :class="classes.clearIcon"></span>
        </span>
    </template>
</Multiselect>

Demo

Unable to produce demo due to no available CDN for Headless UI.

@rizkhal
Copy link

rizkhal commented Jan 25, 2022

Hy @stevebauman, did you find the solution?

@stevebauman
Copy link
Author

Hi @rizkhal, yes I mentioned the solution in the description of this issue 👍

@rizkhal
Copy link

rizkhal commented Jan 26, 2022

Oh yes, i followed your instructions but still not working, then i added @click.prevent and it works fine.. Thanks

@giusepetroso
Copy link

Hi guys, I'm facing the same error.

First i noticed the issue with selected tags clear button
I fixed it using @click in the "clear" slot
Then I got the same issue on the clear button of the select itself.
Can't find a way to make it work

If anyone have suggestions they'll be appreciated

@stale
Copy link

stale bot commented May 8, 2022

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs.

@stale stale bot added the stale label May 8, 2022
@ejirocodes
Copy link

Thanks @stevebauman, you're a genius 👍🏽

@stale stale bot removed the stale label May 10, 2022
adamberecz added a commit that referenced this issue May 30, 2022
@adamberecz
Copy link
Collaborator

adamberecz commented May 30, 2022

Fixed in 2.4.0 - thanks guys. Please reopen if you still encounter the issue.

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

5 participants