Get rid of jQuery in dialog events.

Created on 29 September 2023, almost 2 years ago
Updated 30 June 2024, about 1 year ago

Problem/Motivation

https://www.drupal.org/project/drupal/issues/2158943 📌 Add a native dialog element to deprecate the jQuery UI dialog Needs work looks like a herculean task. Therefore, it is necessary to break it down into small sub-tasks that will bring us closer to the final result.

Proposed resolution

Remove jQuery Event from dialog events events. And pass the special `DrupalDialogEvent extends Event` instead.

API changes

Rewrite all core $(window).on({'dialog:... to customEvent listeners to avoid core gitlab CI failures about deprecation messages.

$(window).on('dialog:EVENTTYPE') still BC but their listeners will receive deprecation messages.

$(window).on('dialog:beforecreate') became window.addEventListener('dialog:beforecreate')

Deprecation script checking if old `dialog:beforecreate` presented in $._data(window, 'events');
If presented we trigger deprecation message.

Testing instructions.

1. Review changed dialogs. They should work as before patch.
2. Revert any of changed dialog. Or use some contrib module which uses `dialog:EVENTTYPE` -> you will get deprecation message in console while dialog after/before create/close.

📌 Task
Status

Fixed

Version

10.3

Component
Javascript 

Last updated 3 days ago

Created by

🇷🇸Serbia finnsky

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024