vue-multiselect icon indicating copy to clipboard operation
vue-multiselect copied to clipboard

[Feature request] "Always open" mode for more flexible use of multiselect

Open yk1711 opened this issue 8 years ago • 17 comments

externalcall

In one of the UI's I'm implementing the requirement is for a button to open a popover with multiselect-type options.

I think having an alwaysOpen prop would open multiselect for more flexible use cases like this one. Sometimes there is a need to control multiselect dropdown visibility externally rather than only rely on search input focus and I think this kind of prop multiplies what can be done with multiselect.

I've had to do it in my fork and it's relatively easy with few additions. Would you consider adding this into the core ?

yk1711 avatar Jul 21 '17 00:07 yk1711

Hi. Adding yet another configuration option is something to think about. We will let you know next week

pczarn avatar Jul 21 '17 16:07 pczarn

Hi. I am actually developing the same behaviour and i want to know if it's possible to add a prop to update isOpen data value ?

gjamot avatar Sep 27 '17 09:09 gjamot

+1 for this feature. inline mode some times better than dropdown for usability and so on.

Default html select tag with multiple attribute is inline, will be good to have same feature in vue-multiselect.

sky-code avatar Oct 19 '17 11:10 sky-code

+1 for this one!

onhernandes avatar Dec 21 '17 13:12 onhernandes

would like this as well.. a way to have it always expanded but with a fixed height and scrollable pane if content exceeds the height

vesper8 avatar Feb 26 '18 09:02 vesper8

+1

shankarho avatar Nov 16 '18 16:11 shankarho

This will be possible in the 3.0 release. Please be patient.

shentao avatar Nov 16 '18 17:11 shentao

This will be possible in the 3.0 release. Please be patient.

when is 3.0 release scheduled?

EdgarsSalmins avatar Apr 10 '19 13:04 EdgarsSalmins

Would love it, when is 3.0?

openpathgit avatar Jul 31 '19 19:07 openpathgit

+1

sombatos avatar Aug 21 '19 08:08 sombatos

Any updates (or workarounds) here?

mwager avatar Aug 26 '19 12:08 mwager

Any way to achieve this currently with v2? Also, is this option available as part of the v3 branch currently? @shentao ?

vesper8 avatar Nov 10 '19 10:11 vesper8

This is something else I am looking to do, I have very similar requirements as @yk1711. If this is still in development, how did you manage to get it working @yk1711?

doutatsu avatar Jun 09 '20 15:06 doutatsu

@doutatsu As a workaround, to have the multiselect open by default, you can set a ref on the multiselect component and call the activate method on the ref element. For example, assign a ref to the component

<multiselect
      ref="your_ref_name"
.....
/>

and then call the activate method by this.$refs["your_ref_name"].activate();

itslit-tech avatar Jul 22 '20 05:07 itslit-tech

<multiselect :multiple="true" openDirection="bottom"
:close-on-select="false" :clear-on-select="false" ref="multiselect" @close="closeEventHandler"

..... /> mounted(){ this.$refs.multiselect.isOpen = ture; } closeEventHandler(){ this.$refs.multiselect.isOpen = ture; }

euizong avatar Jul 23 '20 02:07 euizong

The above code was not working for me so I did it using CSS code.

<---- HTML CODE ----->

<multiselect v-model="value" ref="multiselect" @close="closeEventHandler" open-direction="bottom" :hide-selected="true" :close-on-select="false" :clear-on-select="false" :options="options" :multiple="true" group-values="libs" group-label="language" :group-select="true" placeholder="Type to search" track-by="name" label="name"><span slot="noResult">Oops! No elements found. Consider changing the search query.</span></multiselect>

<---- CSS CODE ----->

 .multiselect {
  min-height: 400px;
}
.multiselect .multiselect__input {
  width: 100% !important;
  position: static !important;
  padding: inherit !important;
}
.multiselect .multiselect__content-wrapper {
  display: block !important;
  height: auto !important;
  max-height: 300px !important;
  position: static;
}
.multiselect .multiselect__placeholder {
  display: none !important;
}
.multiselect .multiselect__tags {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.multiselect--above .multiselect__content-wrapper {
  bottom: inherit;
  border-radius: 0;
  border-bottom: none;
  border-top: none;
}
.multiselect .multiselect__select {
  display: none;
}

<---- JS CODE ----->

methods: {
    closeEventHandler() {
      this.$refs.multiselect.isOpen = true;
    },
},

akashjain132 avatar Jan 08 '21 12:01 akashjain132

Make a function and call it to your component like the below example

function openMultiselect() {
  nextTick(() => {
    if (multiselectRef.value) {
      multiselectRef.value.activate();
    }
  });
}
<Multiselect
  ref="multiselectRef"
  @close="openMultiselect"
/>

nikosdrog avatar May 21 '24 07:05 nikosdrog