Skip to content

Commit ed0bae3

Browse files
committed
Check if search should be focused when the dropdown is activated
1 parent ad21d01 commit ed0bae3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

select2.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2144,7 +2144,11 @@ the specific language governing permissions and limitations under the Apache Lic
21442144
killEvent(e);
21452145
}));
21462146

2147-
dropdown.on("mousedown touchstart", this.bind(function() { this.search.focus(); }));
2147+
dropdown.on("mousedown touchstart", this.bind(function() {
2148+
if (this.opts.shouldFocusInput(this)) {
2149+
this.search.focus();
2150+
}
2151+
}));
21482152

21492153
selection.on("focus", this.bind(function(e) {
21502154
killEvent(e);

0 commit comments

Comments
 (0)