From 985deb41832bd1bd229f0d4164196aae3a10dd11 Mon Sep 17 00:00:00 2001 From: Tobias Buschor Date: Wed, 25 May 2022 03:42:26 +0200 Subject: [PATCH 1/2] Detect contenteditable elements An element can have the `contenteditable` value "true" but also "" (emty string) or to be editable. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable But anyway, an easier way to see if it's a contenteditable-root element is to use the property `node.contentEditable`, which has wide support. See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable --- Focusgroup/focusgroup_polyfill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Focusgroup/focusgroup_polyfill.js b/Focusgroup/focusgroup_polyfill.js index 248be0fe..fb1edb37 100644 --- a/Focusgroup/focusgroup_polyfill.js +++ b/Focusgroup/focusgroup_polyfill.js @@ -238,7 +238,7 @@ class FocusGroupManager { return true; if ( node.nodeName == "TEXTAREA" && !node.hasAttribute( "disabled" ) ) return true; - if ( node.hasAttribute( "contenteditable" ) && node.getAttribute("contenteditable") == "true" ) + if ( node.contentEditable === 'true' ) return true; if ( node.nodeName == "IFRAME" ) return true; From 7d5bfba2b26c1c8eef9dfda7c22462c7a9f9234d Mon Sep 17 00:00:00 2001 From: Tobias Buschor Date: Wed, 25 May 2022 03:58:48 +0200 Subject: [PATCH 2/2] Update focusgroup_polyfill.js --- Focusgroup/focusgroup_polyfill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Focusgroup/focusgroup_polyfill.js b/Focusgroup/focusgroup_polyfill.js index fb1edb37..8f4bbf66 100644 --- a/Focusgroup/focusgroup_polyfill.js +++ b/Focusgroup/focusgroup_polyfill.js @@ -238,7 +238,7 @@ class FocusGroupManager { return true; if ( node.nodeName == "TEXTAREA" && !node.hasAttribute( "disabled" ) ) return true; - if ( node.contentEditable === 'true' ) + if ( node.contentEditable === "true" ) return true; if ( node.nodeName == "IFRAME" ) return true;