57

I changed my jQuery 1.7.2 to 3.1.1 and changed my jQuery UI from version 1.8.16 to version 1.12.1.

Quite a few of my existing JS stuff broke, like styling of buttons, and dialog behaves in unexpected manner, i.e. half of modal dialog is covered up by the mysterious <div class="ui-widget-overlay ui-front"></div>

I suspected jQuery UI to be at fault due to the covering above. I went to jQuery UI site and I see that stable version is for jQuery 1.7+.

Does that mean that I should be using jQuery 1.x with jQuery UI, or can I use jQuery 3.x okay (plus ... try to figure out why my styling and functionality broke)?

4
  • 1
    Did you change both jquery-ui css AND js files? Did you refresh (&clear cache)? Commented Nov 8, 2016 at 18:28
  • Did you update the code to take into account all the breaking changes between 1.8.16->1.12.1 and all the changes between 1.7.2 and 3.1.1? Commented Nov 8, 2016 at 18:30
  • @Dekel, Was not aware of jquery-ui CSS... will take a look. Kevin: no, did not take anything into account. Commented Nov 8, 2016 at 18:37
  • @Dekel - downloading and updating CSS fixed the issue. Thanks Commented Nov 8, 2016 at 19:46

2 Answers 2

46

jQueryUI supports the following jQuery version range:

"dependencies": {
    "jquery": ">=1.7.0 <4.0.0"
},

I'd say you're good to go.

Source: https://github.com/jquery/jquery-ui/blob/master/package.json#L49

It might be that you're seeing a lot of broken components because either you're not importing their CSS or you're overriding their CSS.

Sign up to request clarification or add additional context in comments.

2 Comments

It may work, but not fully. Consider to use jQuery Migrate to have polyfills for deprecated functions.
Most of animations do not work UI 1.12.1 and jQuery 3.4.1. For example jqueryUI hide(easingname, options, callback) method will complete the animation then show the object again.
12

Can you use jQuery-UI with jQuery 3.2.1 ?

Imho you can not without having serious problems. See the given example below.

Assume the following configuration:

  • jQuery 3.2.1 (CDN)
  • jQuery UI 1.12.1 (CDN)
  • Detection jQ Migrate 3.0.0 for error detection.

I get the following errors:

  • jQuery.expr[":"] is now jQuery.expr.pseudos in jquery-ui.min.js
  • jQuery.expr.filters is now jQuery.expr.pseudos in query-ui.min.js
  • jQuery.unique is deprecated, use jQuery.uniqueSort

4 Comments

These are warnings rather than errors and it does all appear to work as expected. It's odd that jQuery UI doesn't use the latest jQuery syntax though.
I believe they're only warnings due to the use of jQ Migrate. Without that, I'm pretty sure that they'd be full-on errors.
For anyone else who stumbles across this question: as of jquery 3.4.1, all of the deprecated stuff that jquery-ui uses will throw warnings in the jqmigrate plugin, but they WILL still work - they are not full on errors. The aliases still exist. The jquery-ui authors appear to not really care about updating their library to use the non-deprecated aliases either, so unless you want to fork jquery-ui you sort of have to live with it.
Because the jQuery UI library isn't updated yet, I created a patch. See here: github.com/DenisLabrecque/jQuery-UI-Fixed-for-3.5.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.