From 8b0a91f6027b7d74cd78541bcb0b7e7b8cd3c1ec Mon Sep 17 00:00:00 2001 From: Lauri Eskola Date: Wed, 11 Oct 2023 08:46:33 +0300 Subject: [PATCH] Issue #3351600 by andrew.farquharson, Ranjit1032002, Anybody, sanduhrs, gmateos, smustgrave, Wim Leers, ant1, catch: ckeditor5.dialog.fix.js throws "Uncaught TypeError: event.target.classList is undefined" in Firefox in Drupal 10 with the editor in a modal --- core/modules/ckeditor5/js/ckeditor5.dialog.fix.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/modules/ckeditor5/js/ckeditor5.dialog.fix.js b/core/modules/ckeditor5/js/ckeditor5.dialog.fix.js index 1f4ed1d7feb..41449dcf693 100644 --- a/core/modules/ckeditor5/js/ckeditor5.dialog.fix.js +++ b/core/modules/ckeditor5/js/ckeditor5.dialog.fix.js @@ -12,6 +12,12 @@ // CKEditor 5 in modals can work as expected. // @see https://api.jqueryui.com/dialog/#method-_allowInteraction _allowInteraction(event) { + // Fixes "Uncaught TypeError: event.target.classList is undefined" + // in Firefox (only). + // @see https://www.drupal.org/project/drupal/issues/3351600 + if (event.target.classList === undefined) { + return this._super(event); + } return event.target.classList.contains('ck') || this._super(event); }, });