Skip to content

Commit 115b215

Browse files
committed
Fix JSON editor controls not showing up after load
1 parent 45bc17f commit 115b215

File tree

1 file changed

+16
-16
lines changed
  • packages/data-widgets/lib/widgets

1 file changed

+16
-16
lines changed

packages/data-widgets/lib/widgets/json.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,29 @@ export function WidgetJSON(props: WidgetProps) {
3535
const [isLoaded, setIsLoaded] = useState(false);
3636

3737
return (
38-
<FastField name={props.pointer}>
39-
{({ field: { value }, form: { setFieldValue } }: FastFieldProps) => (
40-
<FormControl>
41-
<Flex gap={4}>
42-
{field.label && (
43-
<FormLabel>
44-
<FieldLabel size='xs'>{field.label}</FieldLabel>
45-
</FormLabel>
46-
)}
47-
{isLoaded && <ControlBar editor={editorRef.current!} />}
48-
</Flex>
38+
<FormControl>
39+
<Flex gap={4}>
40+
{field.label && (
41+
<FormLabel>
42+
<FieldLabel size='xs'>{field.label}</FieldLabel>
43+
</FormLabel>
44+
)}
45+
{isLoaded && <ControlBar editor={editorRef.current!} />}
46+
</Flex>
4947

50-
<Suspense fallback={<Loading />}>
48+
<Suspense fallback={<Loading />}>
49+
<FastField name={props.pointer}>
50+
{({ field: { value }, form: { setFieldValue } }: FastFieldProps) => (
5151
<JsonEditor
5252
value={value}
5353
onChange={(v) => setFieldValue(props.pointer, v)}
5454
editorRef={editorRef}
5555
onLoad={() => setIsLoaded(true)}
5656
/>
57-
</Suspense>
58-
</FormControl>
59-
)}
60-
</FastField>
57+
)}
58+
</FastField>
59+
</Suspense>
60+
</FormControl>
6161
);
6262
}
6363

0 commit comments

Comments
 (0)