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

Dropdown does not close #162

Closed
supermetrolog opened this issue Oct 28, 2021 · 4 comments
Closed

Dropdown does not close #162

supermetrolog opened this issue Oct 28, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@supermetrolog
Copy link

Why does the dropdown not close when clicking on it again like the native dropdown?

@KaloyanYosifov
Copy link

@adamberecz Do you have time to update this?

@adamberecz
Copy link
Collaborator

It's a bit tricky with all the different things in the multiselect container (label, placeholder, search, tags, etc). But I'll look into it when I'll have the time.

@adamberecz adamberecz added the enhancement New feature or request label Dec 16, 2021
@harmnot
Copy link

harmnot commented Jan 18, 2022

you can use ref for this, @supermetrolog @KaloyanYosifov @adamberecz

<template>
  <multiselect @click="clickMe" ref="multiselect" v-model="inputValue" v-bind="$attrs" />
</template> 



  export default {
   data() {
    return {
      open: false,
    }
   },
   methods: {
    clickMe() {
        this.open = !this.open
        if(!this.open) {
           this.$refs.multiselect.close()
        } else {
           this.$refs.multiselect.open()
        }
     }
   }
  }

adamberecz added a commit that referenced this issue May 30, 2022
@adamberecz
Copy link
Collaborator

I can hardly believe this myself but now it's closing on the second click! Thanks for keeping up guys 🙏

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

No branches or pull requests

4 participants