diff --git a/.changeset/fancy-oranges-clap.md b/.changeset/fancy-oranges-clap.md new file mode 100644 index 000000000..83dd29530 --- /dev/null +++ b/.changeset/fancy-oranges-clap.md @@ -0,0 +1,5 @@ +--- +'@embedpdf/plugin-annotation': patch +--- + +Fix FreeText/CalloutFreeText losing typed text when edited after non-isEditing blur diff --git a/packages/plugin-annotation/src/shared/components/annotations/callout-free-text.tsx b/packages/plugin-annotation/src/shared/components/annotations/callout-free-text.tsx index fe6cbd672..646a32209 100644 --- a/packages/plugin-annotation/src/shared/components/annotations/callout-free-text.tsx +++ b/packages/plugin-annotation/src/shared/components/annotations/callout-free-text.tsx @@ -136,6 +136,10 @@ export function CalloutFreeText({ }); }; + const handleInput = () => { + editingRef.current = true; + }; + const width = rect.size.width * scale; const height = rect.size.height * scale; const hitStrokeWidth = Math.max(strokeWidth, MIN_HIT_AREA_SCREEN_PX / scale); @@ -261,6 +265,7 @@ export function CalloutFreeText({ { + editingRef.current = true; + }; + return (