From 86b13655f012c3f946561b7e4f54ba0fa0bf93a1 Mon Sep 17 00:00:00 2001 From: Stuart Date: Mon, 15 Jan 2024 13:58:29 +0000 Subject: [PATCH 1/2] Allow drag for `plaintext-only` contenteditable elements --- .../use-sensor-marshal/is-event-in-interactive-element.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/view/use-sensor-marshal/is-event-in-interactive-element.js b/src/view/use-sensor-marshal/is-event-in-interactive-element.js index 39288cca73..a598c7b904 100644 --- a/src/view/use-sensor-marshal/is-event-in-interactive-element.js +++ b/src/view/use-sensor-marshal/is-event-in-interactive-element.js @@ -35,11 +35,11 @@ function isAnInteractiveElement(parent: Element, current: ?Element) { return true; } - // contenteditable="true" or contenteditable="" are valid ways + // contenteditable="true", contenteditable="" and contenteditable="plaintext-only" are valid ways // of creating a contenteditable container // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable const attribute: ?string = current.getAttribute('contenteditable'); - if (attribute === 'true' || attribute === '') { + if (attribute === 'true' || attribute === '' || attribute === "plaintext-only") { return true; } From fa3d70bfe845a3485cf0ff3619e5a8c344cb3b40 Mon Sep 17 00:00:00 2001 From: Stuart Date: Mon, 15 Jan 2024 14:08:15 +0000 Subject: [PATCH 2/2] Lint --- .../use-sensor-marshal/is-event-in-interactive-element.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/view/use-sensor-marshal/is-event-in-interactive-element.js b/src/view/use-sensor-marshal/is-event-in-interactive-element.js index a598c7b904..0b3b11425d 100644 --- a/src/view/use-sensor-marshal/is-event-in-interactive-element.js +++ b/src/view/use-sensor-marshal/is-event-in-interactive-element.js @@ -39,7 +39,11 @@ function isAnInteractiveElement(parent: Element, current: ?Element) { // of creating a contenteditable container // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable const attribute: ?string = current.getAttribute('contenteditable'); - if (attribute === 'true' || attribute === '' || attribute === "plaintext-only") { + if ( + attribute === 'true' || + attribute === '' || + attribute === 'plaintext-only' + ) { return true; }