Skip to content

Commit 7581fa5

Browse files
committed
Merge pull request select2#2588 from fabdouglas/patch-8
Redirect the focus of original input to Select2
2 parents 0daee34 + 9d19b7f commit 7581fa5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

select2.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,6 +2109,7 @@ the specific language governing permissions and limitations under the Apache Lic
21092109
this.focusser.attr("id", "s2id_autogen"+idSuffix);
21102110

21112111
elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
2112+
this.opts.element.focus(this.bind(function () { this.focus(); }));
21122113

21132114
this.focusser.prev()
21142115
.text(elementLabel.text())
@@ -2697,6 +2698,7 @@ the specific language governing permissions and limitations under the Apache Lic
26972698
this.search.prev()
26982699
.text($("label[for='" + this.opts.element.attr("id") + "']").text())
26992700
.attr('for', this.search.attr('id'));
2701+
this.opts.element.focus(this.bind(function () { this.focus(); }));
27002702

27012703
this.search.on("input paste", this.bind(function() {
27022704
if (this.search.attr('placeholder') && this.search.val().length == 0) return;

0 commit comments

Comments
 (0)