Skip to content

Commit

Permalink
fix contentEditable detection in is_editable
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanatkn committed Mar 8, 2024
1 parent e094243 commit 8ed886d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nasty-dragons-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ryanatkn/belt": patch
---

fix contentEditable detection in `is_editable`
2 changes: 1 addition & 1 deletion src/lib/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const is_editable = (el: any): boolean => {
type === 'url'
);
}
return tagName === 'TEXTAREA' || el.contentEditable === 'true';
return tagName === 'TEXTAREA' || (!!el.contentEditable && el.contentEditable !== 'false');
};

/**
Expand Down

0 comments on commit 8ed886d

Please sign in to comment.