Skip to content

Commit db7cd1b

Browse files
committed
Go back to hiding the original element
This was only done to maintain compatibility with labels, back when we could capture the focus events from the original element. Now that we handle them in a different way, this is no longer needed. This fixes select2#2769.
1 parent e943f6e commit db7cd1b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

select2.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ the specific language governing permissions and limitations under the Apache Lic
871871
select2.liveRegion.remove();
872872
select2.dropdown.remove();
873873
element
874-
.removeClass("select2-offscreen")
874+
.show()
875875
.removeData("select2")
876876
.off(".select2")
877877
.prop("autofocus", this.autofocus || false);
@@ -2273,7 +2273,7 @@ the specific language governing permissions and limitations under the Apache Lic
22732273
}));
22742274

22752275
this.initContainerWidth();
2276-
this.opts.element.addClass("select2-offscreen");
2276+
this.opts.element.hide();
22772277
this.setPlaceholder();
22782278

22792279
},
@@ -2856,7 +2856,7 @@ the specific language governing permissions and limitations under the Apache Lic
28562856
}));
28572857

28582858
this.initContainerWidth();
2859-
this.opts.element.addClass("select2-offscreen");
2859+
this.opts.element.hide();
28602860

28612861
// set the placeholder if necessary
28622862
this.clearSearch();

0 commit comments

Comments
 (0)