Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.

Fix select2 search not auto focusing in jQuery 3.6.0#187

Open
hendra wants to merge 2 commits into
spree:4-4-stablefrom
paneco:fix/select2-dropdown-autofocus
Open

Fix select2 search not auto focusing in jQuery 3.6.0#187
hendra wants to merge 2 commits into
spree:4-4-stablefrom
paneco:fix/select2-dropdown-autofocus

Conversation

@hendra

@hendra hendra commented Aug 8, 2022

Copy link
Copy Markdown

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

allowClear: true
})

if(jQuery().jquery === '3.6.0') {

Copy link
Copy Markdown
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
Copy Markdown
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.

@hendra hendra requested a review from rafalcymerys September 23, 2022 04:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants