Incorrect check for ignored mutation events
authorAlexander Ebert <ebert@woltlab.com>
Fri, 21 May 2021 13:42:07 +0000 (15:42 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 21 May 2021 13:42:07 +0000 (15:42 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js

index ce97b48e8ace684ae40a4e18558f5f0f61074448..890579aac9b034bd35739133e7cd166eaa76cc28 100644 (file)
@@ -37,11 +37,17 @@ $.Redactor.prototype.WoltLabEvent = function() {
                                // WoltLab modification: do not suppress event if nodes have been added
                                // WoltLab modification 2: suppress broken MutationRecords in Vivaldi 1.13 that yield attribute changes without the attribute name
                                // WoltLab modification 3: do not suppres event if nodes have been removed
-                               if (((this.opts.type === 'textarea' || this.opts.type === 'div')
-                                       && (!this.detect.isFirefox() && mutation.target === this.core.editor()[0]) && (mutation.type === 'childList' && !mutation.addedNodes.length && !mutation.removedNodes.length))
-                                       || (mutation.attributeName === 'class' && mutation.target === this.core.editor()[0]
-                                       || (mutation.attributeName === 'data-vivaldi-spatnav-clickable')
-                                       || (mutation.type === 'attributes' && mutation.attributeName === null))
+                               // WoltLab modification 4: suppress mutations caused by `focus-visible.js`
+                               if (
+                                       (
+                                               (this.opts.type === 'textarea' || this.opts.type === 'div')
+                                               && (!this.detect.isFirefox() && mutation.target === this.core.editor()[0])
+                                               && (mutation.type === 'childList' && !mutation.addedNodes.length && !mutation.removedNodes.length)
+                                       )
+                                       || mutation.attributeName === 'class' && mutation.target === this.core.editor()[0]
+                                       || mutation.attributeName === 'data-vivaldi-spatnav-clickable'
+                                       || mutation.type === 'attributes' && mutation.attributeName === null
+                                       || mutation.attributeName === "data-focus-visible-added"
                                )
                                {
                                        stop = true;