From c8a4aa2ab0da2b4a33467986a4091abf7a23b570 Mon Sep 17 00:00:00 2001 From: Jelmer van der Linde Date: Wed, 9 Nov 2022 00:16:33 +0100 Subject: [PATCH] Confusion between `contentEditable` (the attribute) and `isContentEditable` (the interpretation) --- src/content/InPageTranslation.js | 2 +- src/content/OutboundTranslation.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/InPageTranslation.js b/src/content/InPageTranslation.js index e11f764f..141f4a04 100644 --- a/src/content/InPageTranslation.js +++ b/src/content/InPageTranslation.js @@ -664,7 +664,7 @@ export default class InPageTranslation { // Exclude editable elements for the same reason we don't translate the // contents of form input fields. - if (node.contentEditable === "true") + if (node.isContentEditable) return true; return false; diff --git a/src/content/OutboundTranslation.js b/src/content/OutboundTranslation.js index 0ac01bcc..37c921dc 100644 --- a/src/content/OutboundTranslation.js +++ b/src/content/OutboundTranslation.js @@ -460,7 +460,7 @@ export default class OutboundTranslation { } #usePreviewField() { - return this.#target?.isContentEditable === 'true'; + return this.#target?.isContentEditable; } #renderPreviewField() { @@ -541,7 +541,7 @@ export default class OutboundTranslation { #setTargetValue(value) { if ('value' in this.#target) { setValueInput(this.#target, value); - } else if (this.#target.isContentEditable === 'true') { + } else if (this.#target.isContentEditable) { setValueContentEditable(this.#target, value); } else