Skip to content

Commit

Permalink
ts doesn't like my shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
zurfyx committed Nov 27, 2024
1 parent ff14e93 commit a9c12e4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/lexical-utils/src/markSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@ export default function markSelection(
}

function firstTextChild(node: Node): null | Text {
let text: null | Node = node;
while (text !== null && !(text instanceof Text)) {
text = text.firstChild || null;
let current: Node | null = node;
while (current !== null) {
if (current instanceof Text) {
return current;
}
current = current.firstChild;
}
return text;
return null;
}

0 comments on commit a9c12e4

Please sign in to comment.