Skip to content

Commit 4b451d6

Browse files
committed
Get rid of breaking null cast
1 parent 39fb043 commit 4b451d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,12 @@ const getTextContent = (instanceProps: Record<string, unknown>) => {
364364
};
365365

366366
const getEditableComponentPlaceholder = (
367+
instance: Instance,
367368
instanceSelector: InstanceSelector,
368369
instances: Instances,
369370
metas: Map<string, WsComponentMeta>,
370371
mode: "editing" | "editable"
371372
) => {
372-
const instance = instances.get(instanceSelector[0])!;
373-
374373
if (!editablePlaceholderComponents.includes(instance.component)) {
375374
return;
376375
}
@@ -494,6 +493,7 @@ export const WebstudioComponentCanvas = forwardRef<
494493
}
495494

496495
const placeholder = getEditableComponentPlaceholder(
496+
instance,
497497
instanceSelector,
498498
instances,
499499
metas,
@@ -554,6 +554,7 @@ export const WebstudioComponentCanvas = forwardRef<
554554
contentEditable={
555555
<ContentEditable
556556
placeholder={getEditableComponentPlaceholder(
557+
instance,
557558
instanceSelector,
558559
instances,
559560
metas,

0 commit comments

Comments
 (0)