diff --git a/frontend/lib/registry/pop-components/pop-card-list/PopCardListComponent.tsx b/frontend/lib/registry/pop-components/pop-card-list/PopCardListComponent.tsx index f89e44e6..585bea94 100644 --- a/frontend/lib/registry/pop-components/pop-card-list/PopCardListComponent.tsx +++ b/frontend/lib/registry/pop-components/pop-card-list/PopCardListComponent.tsx @@ -515,13 +515,16 @@ export function PopCardListComponent({ const layoutJson = await screenApi.getLayoutPop(cartListMode.sourceScreenId); const componentsMap = layoutJson?.components || {}; const componentList = Object.values(componentsMap) as any[]; - const matched = cartListMode.cartType - ? componentList.find( - (c: any) => - c.type === "pop-card-list" && - c.config?.cartAction?.cartType === cartListMode.cartType - ) - : componentList.find((c: any) => c.type === "pop-card-list"); + // sourceComponentId > cartType > 첫 번째 pop-card-list 순으로 매칭 + const matched = cartListMode.sourceComponentId + ? componentList.find((c: any) => c.id === cartListMode.sourceComponentId) + : cartListMode.cartType + ? componentList.find( + (c: any) => + c.type === "pop-card-list" && + c.config?.cartAction?.cartType === cartListMode.cartType + ) + : componentList.find((c: any) => c.type === "pop-card-list"); if (matched?.config?.cardTemplate) { setInheritedTemplate(matched.config.cardTemplate); } diff --git a/frontend/lib/registry/pop-components/pop-card-list/PopCardListConfig.tsx b/frontend/lib/registry/pop-components/pop-card-list/PopCardListConfig.tsx index eb1f565e..696f4821 100644 --- a/frontend/lib/registry/pop-components/pop-card-list/PopCardListConfig.tsx +++ b/frontend/lib/registry/pop-components/pop-card-list/PopCardListConfig.tsx @@ -933,15 +933,18 @@ function CartListModeSection({ const handleComponentSelect = (val: string) => { if (val === "__none__") { - onUpdate({ ...mode, cartType: undefined }); + onUpdate({ ...mode, cartType: undefined, sourceComponentId: undefined }); return; } - // cartType 직접 매칭 또는 componentId 매칭 (__comp_ 접두사) const found = val.startsWith("__comp_") ? sourceCardLists.find((c) => c.componentId === val.replace("__comp_", "")) : sourceCardLists.find((c) => c.cartType === val); if (found) { - onUpdate({ ...mode, cartType: found.cartType || undefined }); + onUpdate({ + ...mode, + sourceComponentId: found.componentId, + cartType: found.cartType || undefined, + }); } }; @@ -997,7 +1000,11 @@ function CartListModeSection({ ) : (