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

close-on-select does not work with group-select #1158

Open
SloppyFresh opened this issue Nov 7, 2019 · 9 comments
Open

close-on-select does not work with group-select #1158

SloppyFresh opened this issue Nov 7, 2019 · 9 comments

Comments

@SloppyFresh
Copy link

Reproduction Link

https://jsfiddle.net/wbeuyqv8/

Steps to reproduce

Create a multiselect with both group-select and close-on-select set to true. When a normal option is selected, the control closes itself. However, when the group options are selected, the control does not close itself.

Expected behaviour

When a group option is selected, the control should close itself.

Actual behaviour

When a group option is selected, the control does not close itself.

@jonascarlbaum
Copy link
Contributor

Is there any workaround on this?

Like listen on @input and calling something on the component by ref or something?

@jonascarlbaum
Copy link
Contributor

jonascarlbaum commented Feb 25, 2020

@shentao is my thought in previous comment achievable to do?

I can't find any documentation on how to call something on component to close select or something, but I guess that if it exists it would be ok for now, until a boolean property for close-on-group-select is created, or close-on-select can take values such as true/false/item/group/all/group-and-item (just brainstorming).

@jonascarlbaum
Copy link
Contributor

@shentao I did a PULL request, with proposed solution.

#1206

I guess that would be the best solution, it's quick and respects the closeOnSelect-property and if you feel you can make fine-grained properties later on, but that's probably bigger effort. ;)

@001123
Copy link

001123 commented Aug 12, 2020

It still happens, is any solution for this?

@Aterr
Copy link

Aterr commented Aug 16, 2020

Same here. Select is not closed after group was selected.

@jonascarlbaum
Copy link
Contributor

Well, my pull-request is accepted, should work, but NPM package isn’t updated. Maybe @shentao can do that when he finds time for it!? 😉

@jonascarlbaum
Copy link
Contributor

jonascarlbaum commented Aug 16, 2020

@Aterr and @001123 — since the npm-package isn’t updated, it doesn’t matter my pull-request is accepted and is in the code base… So we have to rely on @shentao doing a npm-release — then we can update our npm-package references to use the new release and it will behave as we desire in our projects… 👌👍

@jonascarlbaum
Copy link
Contributor

jonascarlbaum commented Aug 16, 2020

…or maybe change reference to shentao/vue-multiselect#master, if I understand it correctly it will use this github repo directly instead of latest released npm-package.

I haven’t tried that one though…

@damienrave
Copy link

damienrave commented Sep 24, 2020

Hi, for those among you awaiting a new release, I have found a quick fix : add a ref property on the multiselect and call the deactivate() function when the @select event is fired :

<multiselect ref="mySelect" @select="selected" />
export default {
    methods: {
        selected() {
            this.$refs.mySelect.deactivate();
        }
    }
}
</script>

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