1
0
mirror of synced 2025-02-16 20:13:16 +03:00

Merge pull request #2588 from fabdouglas/patch-8

Redirect the focus of original input to Select2
This commit is contained in:
Kevin Brown 2014-10-31 18:13:47 -04:00
commit 7581fa5708

View File

@ -2109,6 +2109,7 @@ the specific language governing permissions and limitations under the Apache Lic
this.focusser.attr("id", "s2id_autogen"+idSuffix);
elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
this.opts.element.focus(this.bind(function () { this.focus(); }));
this.focusser.prev()
.text(elementLabel.text())
@ -2697,6 +2698,7 @@ the specific language governing permissions and limitations under the Apache Lic
this.search.prev()
.text($("label[for='" + this.opts.element.attr("id") + "']").text())
.attr('for', this.search.attr('id'));
this.opts.element.focus(this.bind(function () { this.focus(); }));
this.search.on("input paste", this.bind(function() {
if (this.search.attr('placeholder') && this.search.val().length == 0) return;