Skip to content

Commit

Permalink
fix: Double input of text when composing at TextNode boundaries (face…
Browse files Browse the repository at this point in the history
  • Loading branch information
matsuyama-k1 authored Mar 29, 2024
1 parent 4c37c10 commit 10996ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/lexical/src/LexicalUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,13 +713,15 @@ export function $shouldInsertTextAfterOrBeforeTextNode(
if (offset === 0) {
return (
!node.canInsertTextBefore() ||
!parent.canInsertTextBefore() ||
(!parent.canInsertTextBefore() && !node.isComposing()) ||
isToken ||
$previousSiblingDoesNotAcceptText(node)
);
} else if (offset === node.getTextContentSize()) {
return (
!node.canInsertTextAfter() || !parent.canInsertTextAfter() || isToken
!node.canInsertTextAfter() ||
(!parent.canInsertTextAfter() && !node.isComposing()) ||
isToken
);
} else {
return false;
Expand Down

0 comments on commit 10996ae

Please sign in to comment.