davidstutz / bootstrap-multiselect

JQuery multiselect plugin based on Twitter Bootstrap.
https://davidstutz.github.io/bootstrap-multiselect/
Other
3.66k stars 1.99k forks source link

Dropdown / Dropup fixed #1256

Closed cecilmilleriouxGit closed 1 year ago

cecilmilleriouxGit commented 1 year ago

Hello, thank you very much for this work.

I have a problem, when I filter a dropdown and clear the entry, the dropdown does not return to its fixed position.

I have to scroll or click for it to snap back into position.

Do you have a solution?

MX-MKULTRA-VMware-Workstation-2023-04-10-16-03-48

cecilmilleriouxGit commented 1 year ago

Solve with this .multiselect-container{ min-height: 300px; }

I tried with that, but I'm still trying to figure out how the width is determined by its alignment with the width of the button. Edit: found this. Find out how to create an option correctly as with the others. static/js/bootstrap-multiselect.js:460 popupContainer: '<div class="multiselect-container dropdown-menu" style="width: 279px"></div>',

MX-MKULTRA-VMware-Workstation-2023-04-10-18-34-49

cecilmilleriouxGit commented 1 year ago

ok need to update this function : synchronizeButtonAndPopupWidth()

cecilmilleriouxGit commented 1 year ago

I suggest the following changes.

` // Set min width to 90% of height if height is specified without width if (!this.options.minWidth){ this.$popupContainer.css({ 'min-width': this.options.maxHeight * 0.90 +"px" }) } } `

` // Set min height of dropdown menu if specified if (this.options.minHeight) { this.$popupContainer.css({ 'min-height': this.options.minHeight +"px" }) } `

` // Set max width of dropdown menu if specified. if (this.options.maxWidth) { this.$popupContainer.css({ 'max-width': this.options.maxWidth +"px", 'overflow-x': 'hidden' }) }`

` // Set min width of dropdown menu if specified. if (this.options.minWidth) { this.$popupContainer.css({ 'min-width': this.options.minWidth +"px" }) }`