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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery.isArray is deprecated; use Array.isArray 馃悰 #267

Closed
jamesleesaunders opened this issue Feb 8, 2024 · 3 comments
Closed

jQuery.isArray is deprecated; use Array.isArray 馃悰 #267

jamesleesaunders opened this issue Feb 8, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jamesleesaunders
Copy link

Bug Description

While testing django-select2 with the latest version of jQuery there is a deprecation notice:

This is fixed in the latest version os select2 (4.1.0) but django-select2 is shipping with (4.0.13).

jQuery.isArray is being removed in jQuery 4.0.

Im Using: django-select2: 8.1.2

Also see: select2/select2#6298

jquery.js:1 JQMIGRATE: Migrate is installed with logging active, version 3.4.1
jquery.js:1 jQuery Version 3.7.1 Loaded
jquery.js:1 JQMIGRATE: jQuery.isArray is deprecated; use Array.isArray <-- HERE.
a @ jquery.js:1
t.<computed> @ jquery.js:1
n._resolveLanguage @ select2.full.min.js:2
n.applyFromElement @ select2.full.min.js:2
e @ select2.full.min.js:2
d @ select2.full.min.js:2
(anonymous) @ select2.full.min.js:2
each @ jquery.js:1
each @ jquery.js:1
r.fn.select2 @ select2.full.min.js:2
initHeavy @ django_select2.js:48
(anonymous) @ django_select2.js:56
each @ jquery.js:1
        if (self.options.get('debug') && window.console && console.error) {
          // Check to make sure that the response included a `results` key.
          if (!results || !results.results || !$.isArray(results.results)) {             <--- HERE
            console.error(
              'Select2: The AJAX results did not return an array in the ' +
              '`results` key of the response.'
            );
          }
        }

Steps to Reproduce

Install jquery-migrate plugin.
Open browser console.
View warning:jQuery.isArray is being removed in jQuery 4.0.

Expected Behavior

I expect django-select2 to be prepared for the use of jQuery 4.0.0

@codingjoe
Copy link
Owner

Hi @jamesleesaunders,

Thank you for reaching out. However, I am afraid, the issue you are describing is in Select2. There is already an open issue regarding your question as well, right here: select2/select2#6298

I am taking the liberty to close this issue. Since we don't bundle Select2 but point to the latest release, the issue will resolve itself.

Cheers!
Joe

@codingjoe codingjoe closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2024
@jamesleesaunders
Copy link
Author

jamesleesaunders commented Feb 9, 2024

Thanks @codingjoe understood.
The current version of django-select2 v8.1.2 is shipping with select2.js v4.0.13.
(where the latest is v4.1.0).

Understood you bundle the latest at point of release.
select2.js has already made a number of changes in preparation for jQuery4 removing deprecated jQuery functions, once select2/select2#6298 is concluded and fully tested will you (django-select2) also be releasing a new version so that it also supports jQuery4?

  • I appreciate jQuery4 only came out a few days ago and is still in beta, this is just in preparation.

Thanks for providing django-select2 !!

@codingjoe
Copy link
Owner

We use Django's vendored version by default, but you can provide your own version, via the SELECT2_JS setting.

However, if you open a ticket on the Django project itself. I am happy to help you get it pushed into the next bugfix release of Django. Just post the link to the issue on code.djangoproject.com here, an I am happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants