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

How to trigger the drop down to open?

Open donnyv opened this issue 7 years ago • 4 comments

Is there a way using code to trigger the opening of the drop down? I looked through the methods and didn't see one. I hacked a way by adding the "open" class but was curious if there was a method to do this.

If I could add this as an option to be open when rendered that would be very handy also.

donnyv avatar Apr 03 '18 15:04 donnyv

I'm also working around this by simulating a click event on it.

luispabon avatar May 08 '18 15:05 luispabon

I had the same issue, although I found a workaround for this: $("elementId").dropdown('toggle') but it doesn't open in the appropriate position.

iPazooki avatar Nov 08 '18 09:11 iPazooki

any updates?

nicdnepr avatar Dec 19 '18 21:12 nicdnepr

Since this repo hasnt been updated in close to 2 years, I didn't create a PR for this, but...

I added the following as a function to the codebase:

        /**
         * Toggles open/closed the dropdown
         */
        toggle: function () {
            this.$button.click();
        },

And toggle it open/closed by calling $("elementId").multiselect("toggle").

this.$button.click() is how this plugin handles opening and closing the dropdown. So seemed the appropriate approach.

vbanuelos avatar Apr 16 '20 15:04 vbanuelos