Skip to content

Commit

Permalink
Merge pull request #16 from s-eckard/develop
Browse files Browse the repository at this point in the history
Fix gap between dropdown menu and select
  • Loading branch information
d-langstein authored Jun 2, 2021
2 parents 6fd420a + 61fe50b commit 7c7fede
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions dist/js/bootstrap-multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,8 @@
this.updateOptGroups();
}

this.updatePopupPosition();

this.options.onFiltering(event.target);

}, this), 300, this);
Expand All @@ -1290,6 +1292,28 @@
}
},

updatePopupPosition: function() {
// prevent gaps between popup and select when filter is used (#1199)

var transformMatrix = this.$popupContainer.css("transform");
var matrixType = transformMatrix.substring(0, transformMatrix.indexOf('('));
var values = transformMatrix.substring(transformMatrix.indexOf('(') + 1, transformMatrix.length - 1);
var valuesArray = values.split(',');

var valueIndex = 5;
if(matrixType === "matrix3d") {
valueIndex = 13;
}

var yTransformation = valuesArray[valueIndex].trim();
if (yTransformation < 0) {
yTransformation = this.$popupContainer.css("height").replace('px', '') * -1;
valuesArray[valueIndex] = yTransformation;
transformMatrix = matrixType + '(' + valuesArray.join(',') + ')';
this.$popupContainer.css("transform", transformMatrix);
}
},

/**
* Unbinds the whole plugin.
*/
Expand Down
Loading

0 comments on commit 7c7fede

Please sign in to comment.