Skip to content

Commit

Permalink
Confusion between contentEditable (the attribute) and `isContentEdi…
Browse files Browse the repository at this point in the history
…table` (the interpretation)
  • Loading branch information
jelmervdl committed Nov 8, 2022
1 parent 5ef9ac9 commit c8a4aa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/content/InPageTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/content/OutboundTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export default class OutboundTranslation {
}

#usePreviewField() {
return this.#target?.isContentEditable === 'true';
return this.#target?.isContentEditable;
}

#renderPreviewField() {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c8a4aa2

Please sign in to comment.