Skip to content

Commit

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

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

Expand Down

0 comments on commit ab395cd

Please sign in to comment.