From ef8c49f85f02c99bda691ae304e83f8c753a1418 Mon Sep 17 00:00:00 2001 From: Bob Burton Date: Thu, 8 Nov 2012 08:45:56 +1030 Subject: [PATCH] * Fix of issue 550 Select2 and CSS Transforms: dropdown menu is off position: https://github.com/ivaynberg/select2/issues/550 jquery offset() returns incorrect value when ancestor container has css transform applied to it, causing dropdown to appear in incorrect position. Using { top: variable.offsetTop, left: variable.offsetLeft } instead of variable.offset() fixes this issue Signed-off-by: Igor Vaynberg --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index acad1d09..34d25154 100644 --- a/select2.js +++ b/select2.js @@ -976,7 +976,7 @@ the specific language governing permissions and limitations under the Apache Lic // abstract positionDropdown: function() { - var offset = this.container.offset(), + var offset = { top: this.container[0].offsetTop, left: this.container[0].offsetLeft }, height = this.container.outerHeight(false), width = this.container.outerWidth(false), dropHeight = this.dropdown.outerHeight(false),