File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -107,17 +107,10 @@ export default function Keybinding(props: KeybindingProps) {
107107}
108108
109109/**
110- * Return true if the current DOM node or one of its parent has the contenteditable
111- * attribute activated
110+ * Return true if the current DOM node or one of its parents has contenteditable activated
112111 */
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 ) ;
112+ function checkIfContentEditable ( node : HTMLElement ) {
113+ return (
114+ node . closest ( '[contenteditable]:not([contenteditable="false"])' ) !== null
115+ ) ;
123116}
You can’t perform that action at this time.
0 commit comments