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

Downgrade jQuery to 3.5.1 from 3.6.0 to re-enable select2 autofocus #11157

Merged
merged 1 commit into from
May 18, 2022

Conversation

uberbrady
Copy link
Collaborator

NOTE: requires npm install/asset rebuild

Fixes [sc-19093]. This is actually a select2+jQuery 3.6.0 bug, as documented here: select2/select2#5993

There are several different workarounds, some that are different in a Bootstrap Modal context, and some elsewhere (we need both) - but they junk up the code and they didn't work very consistently for me - and I tried many, if not all, of them.

Instead what I went with was downgrading jQuery to 3.5.1. I was concerned that the previous version of jQuery might have some security vulnerabilities, but I didn't see anything here: https://snyk.io/vuln/npm:jquery@3.5.1 nor elsewhere, so I think we may be okay?

Once a newer version of Select2 is released (there is a v4.1 that is in beta), we may be able to upgrade both packages and have the autofocus still work - but it doesn't necessarily seem like that based on what I'm seeing in the Select2 repository right now.

@uberbrady uberbrady requested a review from snipe as a code owner May 18, 2022 20:33
@snipe snipe merged commit 9e9d371 into snipe:develop May 18, 2022
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.

None yet

2 participants