Skip to content

Commit b757fb9

Browse files
committed
issue select2#1778: prevent delayed focus when the list is hidden
This reset the focus color when the TAB key is pressed.
1 parent cb7aefa commit b757fb9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

select2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,9 @@ the specific language governing permissions and limitations under the Apache Lic
19731973
// without this the search field loses focus which is annoying
19741974
if (document.activeElement === this.body().get(0)) {
19751975
window.setTimeout(this.bind(function() {
1976-
this.search.focus();
1976+
if (this.opened()) {
1977+
this.search.focus();
1978+
}
19771979
}), 0);
19781980
}
19791981
}));

0 commit comments

Comments
 (0)