Remove dependency on jQuery UI

Created on 15 October 2019, about 5 years ago
Updated 7 May 2024, 8 months ago

Change record: JQuery UI is being phased out from Drupal core .

Up to now, Core’s autocomplete used jQuery UI. We’ll have to see what it uses now and change our overrides accordingly.

📌 Task
Status

Active

Version

1.0

Component

General code

Created by

🇦🇹Austria drunken monkey Vienna, Austria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom sittard

    I'm keen to see this progressing.

    I've been debugging our site and I've noticed with search autocomplete enabled the site includes around 50 JS files and with search autocomplete disabled this reduces down to 20 JS files.

    It looks like the module has a dependency on `drupal.autocomplete` which has a further dependencies on `core/internal.jquery_ui` and `core/drupal.ajax`

    It would be good to address this to improve performance and SEO.

    Thanks.

  • 🇬🇧United Kingdom sittard

    Also just reposting the suggestion from @lukus to replace the autocomplete element with this contrib module:
    https://www.drupal.org/project/a11y_autocomplete_element

    Plus also pointing to related issue ( https://www.drupal.org/project/drupal/issues/3076171 📌 Provide a new library to replace jQuery UI autocomplete Needs work ) - long read!!! See comment at top.

  • 🇦🇹Austria drunken monkey Vienna, Austria

    I’m open to any suggestions and MRs. I’m not that good with Javascript myself and have very limited time, so replacing all of this module’s Javascript in order to work with some replacement won’t be possible for me.

  • 🇬🇧United Kingdom sittard

    I had a quick go:

    1) Installed a11y_autocomplete_element module ( https://www.drupal.org/project/a11y_auto )
    2) Replaced ''#type' => 'a11y_autocomplete' anywhere you'd use '#type' => 'select'"
    3) Replace dependency 'core/autocomplete' with 'a11y_autocomplete_element/a11y_autocomplete_element'
    4) drush cr

    For some reason `/core/misc/autocomplete.js` library is still loading, any idea why?

    Thanks.

Production build 0.71.5 2024