diff --git a/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx b/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx index c8e3017..18b2a21 100644 --- a/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx +++ b/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx @@ -264,6 +264,10 @@ export default function LabelStudioTextEditor() { () => (project?.datasetType || "").toUpperCase() === "TEXT", [project?.datasetType], ); + const segmentIndices = useMemo(() => { + if (segmentTotal <= 0) return [] as number[]; + return Array.from({ length: segmentTotal }, (_, index) => index); + }, [segmentTotal]); const focusIframe = useCallback(() => { const iframe = iframeRef.current; @@ -982,10 +986,22 @@ export default function LabelStudioTextEditor() {