Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Added zindex options to dropdown #114

wants to merge 1 commit into from

3 participants


On positionDropdown(), we assign zindex to the dropdown that can be specified in the options as zIndex.

By default this value is 2000 (Modal is usually in the 1000s)


this should be renamed to dropdownZIndex. zIndex by itself is not clear enough. also i would not have a default value for it. allow people to set it via css by default.


this line should only set it if it was defiend in opts


Give me a few minutes, i deleted the branch too soon :/

@pothibo pothibo closed this

does this code to setZindex still exist. I was looking at select2.js but couldn't find dropdownZIndex.
Kindly point me if it's still available.


Sorry, I can't. I'm not using Select2.js anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 14, 2012
  1. @pothibo

    Added zindex options to dropdown so we can make sure it presents itse…

    pothibo committed
    …lf on top of whatever is existing in the DOM
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 select2.js
4 select2.js
@@ -540,6 +540,7 @@
formatInputTooShort: function (input, min) { return "Please enter " + (min - input.length) + " more characters"; },
minimumResultsForSearch: 0,
minimumInputLength: 0,
+ zIndex: 2000,
id: function (e) { return; },
matcher: function(term, text) {
return text.toUpperCase().indexOf(term.toUpperCase()) >= 0;
@@ -654,7 +655,8 @@
top: + height,
left: offset.left,
- width: width
+ width: width,
+ "z-index": this.opts.zIndex
Something went wrong with that request. Please try again.