Skip to content

Commit

Permalink
fix(grouping): only expand group when creating a new element after it…
Browse files Browse the repository at this point in the history
… is created

GitOrigin-RevId: 17a66e13c528e37fa2db61cd87dbc30a84715f89
  • Loading branch information
IcaroG authored and actions-user committed Dec 4, 2024
1 parent c6d7676 commit aed6ea5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export function NavigationHeaderRow({
<IconButton
onClick={async (e) => {
e.stopPropagation();
await onAdd();
if (!props.isOpen) {
toggleExpand();
}
await onAdd();
}}
>
<Icon icon={PlusIcon} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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));
},
},
}
Expand Down

0 comments on commit aed6ea5

Please sign in to comment.