We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d361fa commit 677776dCopy full SHA for 677776d
1 file changed
src/keybinding.tsx
@@ -107,17 +107,10 @@ export default function Keybinding(props: KeybindingProps) {
107
}
108
109
/**
110
- * Return true if the current DOM node or one of its parent has the contenteditable
111
- * attribute activated
+ * Return true if the current DOM node or one of its parents has contenteditable activated
112
*/
113
-function checkIfContentEditable(node: HTMLElement | null) {
114
- if (node === null) {
115
- return false;
116
- }
117
-
118
- if (node.getAttribute('contenteditable') === 'true') {
119
- return true;
120
121
122
- return checkIfContentEditable(node.parentElement);
+function checkIfContentEditable(node: HTMLElement) {
+ return (
+ node.closest('[contenteditable]:not([contenteditable="false"])') !== null
+ );
123
0 commit comments