add handling of autofocus attribute. fixes #837
This commit is contained in:
parent
18c2bc5cb9
commit
9c1caa6d3a
@ -736,6 +736,10 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
|
|
||||||
// Calculate size of scrollbar
|
// Calculate size of scrollbar
|
||||||
scrollBarDimensions = scrollBarDimensions || measureScrollbar();
|
scrollBarDimensions = scrollBarDimensions || measureScrollbar();
|
||||||
|
|
||||||
|
this.autofocus = opts.element.prop("autofocus")
|
||||||
|
opts.element.prop("autofocus", false);
|
||||||
|
if (this.autofocus) this.focus();
|
||||||
},
|
},
|
||||||
|
|
||||||
// abstract
|
// abstract
|
||||||
@ -753,6 +757,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
.removeData("select2")
|
.removeData("select2")
|
||||||
.unbind(".select2")
|
.unbind(".select2")
|
||||||
.attr({"tabindex": this.elementTabIndex})
|
.attr({"tabindex": this.elementTabIndex})
|
||||||
|
.prop("autofocus", this.autofocus)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1886,6 +1891,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
this.initContainerWidth();
|
this.initContainerWidth();
|
||||||
this.opts.element.addClass("select2-offscreen");
|
this.opts.element.addClass("select2-offscreen");
|
||||||
this.setPlaceholder();
|
this.setPlaceholder();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// single
|
// single
|
||||||
|
Loading…
Reference in New Issue
Block a user