Skip to content

Commit 3a5bda0

Browse files
committed
fix: rerender group selection when selecting new part
1 parent 525cd59 commit 3a5bda0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/webui/src/client/ui/UserEditOperations/PropertiesPanel.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,14 @@ function EditingTypeChangeSourceLayerSource(props: {
414414
)?.schema
415415
const selectedGroupSchema = jsonSchema ? JSONBlobParse(jsonSchema) : undefined
416416

417+
React.useEffect(() => {
418+
const pendingChange = props.pendingChanges.find((change) => change.operationId === props.userEditOperation.id)
419+
420+
setSelectedSourceButton(pendingChange?.sourceLayerType || props.userEditOperation.currentValues.type)
421+
422+
setSelectedValues(pendingChange?.value || props.userEditOperation.currentValues.value)
423+
}, [props.userEditOperation.id, props.pendingChanges])
424+
417425
const handleSourceChange = () => {
418426
setSelectedValues(selectedValues)
419427
// Add to pending changes instead of executing immediately

0 commit comments

Comments
 (0)