From aed6ea52505f6c43352c1291bee27312b8803b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dcaro=20Guerra?= Date: Wed, 27 Nov 2024 12:08:49 -0300 Subject: [PATCH] fix(grouping): only expand group when creating a new element after it is created GitOrigin-RevId: 17a66e13c528e37fa2db61cd87dbc30a84715f89 --- .../components/sidebar-tabs/ProjectPanel/NavigationRows.tsx | 2 +- .../src/wab/client/components/sidebar/TokenTypeHeader.tsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/platform/wab/src/wab/client/components/sidebar-tabs/ProjectPanel/NavigationRows.tsx b/platform/wab/src/wab/client/components/sidebar-tabs/ProjectPanel/NavigationRows.tsx index 627e4988357..362f4c1ab7a 100644 --- a/platform/wab/src/wab/client/components/sidebar-tabs/ProjectPanel/NavigationRows.tsx +++ b/platform/wab/src/wab/client/components/sidebar-tabs/ProjectPanel/NavigationRows.tsx @@ -66,10 +66,10 @@ export function NavigationHeaderRow({ { e.stopPropagation(); + await onAdd(); if (!props.isOpen) { toggleExpand(); } - await onAdd(); }} > diff --git a/platform/wab/src/wab/client/components/sidebar/TokenTypeHeader.tsx b/platform/wab/src/wab/client/components/sidebar/TokenTypeHeader.tsx index ce422ec3201..cfda56ea05f 100644 --- a/platform/wab/src/wab/client/components/sidebar/TokenTypeHeader.tsx +++ b/platform/wab/src/wab/client/components/sidebar/TokenTypeHeader.tsx @@ -6,7 +6,6 @@ import PlasmicTokenTypeHeader, { } from "@/wab/client/plasmic/plasmic_kit_left_pane/PlasmicTokenTypeHeader"; import { useStudioCtx } from "@/wab/client/studio-ctx/StudioCtx"; import { TokenType, tokenTypeLabel } from "@/wab/commons/StyleToken"; -import { spawn } from "@/wab/shared/common"; import { canCreateAlias } from "@/wab/shared/ui-config-utils"; import { MultiChoiceArg } from "@plasmicapp/react-web"; import * as React from "react"; @@ -67,12 +66,12 @@ function TokenTypeHeader(props: TokenTypeHeaderProps) { ? { render: () => null } : { props: { - onClick: (e) => { + onClick: async (e) => { e.stopPropagation(); + await tokenControls.onAdd(tokenType); if (!isExpanded) { toggleExpand(); } - spawn(tokenControls.onAdd(tokenType)); }, }, }