Last active
August 26, 2022 22:38
-
-
Save peterwegren/bc19b0654652d9202119505c828c7aae to your computer and use it in GitHub Desktop.
Prevent auto-focus on Select2 search input (prevents keyboard popup on Android).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prevent auto-focus on select2 search input | |
$(document).ready(function(){ | |
$('select').on('select2:open', function() { | |
$('.select2-search input').prop('focus', 0); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment