Skip to content

Commit ef8c49f

Browse files
Bob-Plastykivaynberg
authored andcommitted
* 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>
1 parent 6c9aef4 commit ef8c49f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ the specific language governing permissions and limitations under the Apache Lic
976976

977977
// abstract
978978
positionDropdown: function() {
979-
var offset = this.container.offset(),
979+
var offset = { top: this.container[0].offsetTop, left: this.container[0].offsetLeft },
980980
height = this.container.outerHeight(false),
981981
width = this.container.outerWidth(false),
982982
dropHeight = this.dropdown.outerHeight(false),

0 commit comments

Comments
 (0)