Skip to content

Commit

Permalink
Fix issue with inline comments introduced when upgrading to React 19
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinewi committed Jan 9, 2025
1 parent 76c767f commit 9865477
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const CommentPopoverPortal = ({ onSave, embed, onDelete, onClose, onOpenChange,

return (
<Portal>
<StyledPopoverContent onMouseDown={(e) => e.preventDefault()}>
<StyledPopoverContent>
<CommentHeader>
<PopoverTitle>{t("form.comment.comment")}</PopoverTitle>
<ButtonContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const SlateCommentInline = ({ attributes, editor, element, children }: Props) =>
const [open, setOpen] = useState(false);

useEffect(() => {
setOpen(!!element.isFirstEdit);
setTimeout(() => setOpen(!!element.isFirstEdit), 0);
Transforms.select(editor, ReactEditor.findPath(editor, element));
}, [editor, element, element.isFirstEdit]);

Expand Down

0 comments on commit 9865477

Please sign in to comment.