Skip to content

Commit

Permalink
refactor(version): 0.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
slapshin committed Dec 1, 2022
1 parent e8a1511 commit 58cb13f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "jnt-django-toolbox"
version = "0.8.2"
version = "0.8.3"
description = ""
authors = ["junte <[email protected]>"]
classifiers=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@
},
}, options);
$element.select2(settings);
/*
* Hacky fix for a bug in select2 with jQuery 3.6.0's new nested-focus "protection"
* see: https://github.com/select2/select2/issues/5993
* see: https://github.com/jquery/jquery/issues/4382
*
* TODO: Recheck with the select2 GH issue and remove once this is fixed on their side
*/
$element.on('select2:open', function (e) {
const searchInput = $element.data('select2').$dropdown.find('.select2-search__field')[0];
if (searchInput) {
searchInput.focus();
}
});
};

$.fn.djangoAdminSelect2 = function (options) {
Expand Down

0 comments on commit 58cb13f

Please sign in to comment.