From 21cbb9e9f666639619534064a5c7be47d4a85c7b Mon Sep 17 00:00:00 2001 From: "Visal .In" Date: Sat, 16 Mar 2024 20:25:35 +0700 Subject: [PATCH] hotfix: fix edit table not enable --- src/components/schema-sidebar-list.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/schema-sidebar-list.tsx b/src/components/schema-sidebar-list.tsx index 55db0724..a773c8b0 100644 --- a/src/components/schema-sidebar-list.tsx +++ b/src/components/schema-sidebar-list.tsx @@ -69,6 +69,8 @@ export default function SchemaList({ search }: Readonly) { const prepareContextMenu = useCallback( (tableName?: string) => { + console.log(tableName); + return [ { title: "Copy Name", @@ -114,15 +116,24 @@ export default function SchemaList({ search }: Readonly) { return ( + openContextMenuFromEvent( + prepareContextMenu( + selectedIndex && schema[selectedIndex] + ? schema[selectedIndex].name + : undefined + ) + )(e) + } >
{filteredSchema.map((item, schemaIndex) => { return ( { + openContextMenuFromEvent(prepareContextMenu(item.name))(e); + e.stopPropagation(); + }} key={item.name} title={item.name} icon={Table2}