Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix select2 search not auto focusing in jQuery 3.6.0 #187

Open
wants to merge 2 commits into
base: 4-4-stable
Choose a base branch
from

Conversation

hendra
Copy link

@hendra hendra commented Aug 8, 2022

This should fix the select2 search auto focusing when using jQuery 3.6.0

@@ -17,6 +17,12 @@ document.addEventListener("spree:load", function() {
placeholder: Spree.translations.select_an_option,
allowClear: true
})

if(jQuery().jquery === '3.6.0') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you describe in more detail what changed in jquery 3.6 so that this if is required?
Also, if applying such a change it would be great to do a broader check e.g. if version is >= 3.6

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rafalcymerys,

This pull request includes a fix for the search box not focusing immediately after the select is opened for clients using latest jquery v3.6.0. Please see the video below for the issue.

Spree-Administration-Products.webm

Note : I have changed the jQuery version check with broader check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants