From b3d55ae4d5cae9ad09a9c03f1962ba98130e91b2 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 9 Jul 2024 19:50:57 +0200 Subject: [PATCH] fix(ui): cards library disbale inside card clicks --- .../DashboardList/NewDashModal/CardsLibrary.tsx | 10 ++++++---- frontend/app/mstore/types/IconProvider.tsx | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/CardsLibrary.tsx b/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/CardsLibrary.tsx index f8da8fa70..5636c867f 100644 --- a/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/CardsLibrary.tsx +++ b/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/CardsLibrary.tsx @@ -40,7 +40,9 @@ function CardsLibrary(props: Props) { metricStore.fetchList(); }, []); - const onItemClick = (metricId: number) => { + const onItemClick = (e: any, metricId: number) => { + e.stopPropagation(); + e.preventDefault(); props.onCard(metricId); } @@ -49,10 +51,10 @@ function CardsLibrary(props: Props) {
{cards.map((metric: any) => ( -
onItemClick(metric.metricId)}> +
+
onItemClick(e, metric.metricId)} /> -