1
0
mirror of synced 2025-02-09 16:49:24 +03:00

* 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 <igor.vaynberg@gmail.com>
This commit is contained in:
Bob Burton 2012-11-08 08:45:56 +10:30 committed by Igor Vaynberg
parent 6c9aef4bb3
commit ef8c49f85f

View File

@ -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),