Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(table editor): don't show dialog separator for hidden context menu items (#39818)

Charis7ad5891e4570
diff --git a/apps/studio/components/grid/components/menu/RowContextMenu.tsx b/apps/studio/components/grid/components/menu/RowContextMenu.tsx
index 285bc1ecaa0..c4dc8970467 100644
--- a/apps/studio/components/grid/components/menu/RowContextMenu.tsx
+++ b/apps/studio/components/grid/components/menu/RowContextMenu.tsx
@@ -75,16 +75,20 @@ export const RowContextMenu = ({ rows }: RowContextMenuProps) => {
<Copy size={12} />
<span className="ml-2 text-xs">Copy row</span>
</Item>
- <DialogSectionSeparator className="my-1.5" />
- <Item onClick={onEditRowClick} hidden={!snap.editable} data="edit">
- <Edit size={12} />
- <span className="ml-2 text-xs">Edit row</span>
- </Item>
- <DialogSectionSeparator className="my-1.5" />
- <Item onClick={onDeleteRow} hidden={!snap.editable} data="delete">
- <Trash size={12} />
- <span className="ml-2 text-xs">Delete row</span>
- </Item>
+ {snap.editable && (
+ <>
+ <DialogSectionSeparator className="my-1.5" />
+ <Item onClick={onEditRowClick} data="edit">
+ <Edit size={12} />
+ <span className="ml-2 text-xs">Edit row</span>
+ </Item>
+ <DialogSectionSeparator className="my-1.5" />
+ <Item onClick={onDeleteRow} data="delete">
+ <Trash size={12} />
+ <span className="ml-2 text-xs">Delete row</span>
+ </Item>
+ </>
+ )}
</Menu>
)
}