Skip to content

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

Fix TableEditor keyboard copy action copies who cell value even when only a subset is highlighted while editing cell (#38350)

Joshen Limea0bd567f465
diff --git a/apps/studio/components/grid/SupabaseGrid.utils.ts b/apps/studio/components/grid/SupabaseGrid.utils.ts
index 92aa3043d0b..5f6ae0cf5fa 100644
--- a/apps/studio/components/grid/SupabaseGrid.utils.ts
+++ b/apps/studio/components/grid/SupabaseGrid.utils.ts
@@ -214,10 +214,14 @@ export function useLoadTableEditorStateFromLocalStorageIntoUrl({
}
export const handleCopyCell = (
- { column, row }: { column: CalculatedColumn<any, unknown>; row: any },
+ {
+ mode,
+ column,
+ row,
+ }: { mode: 'SELECT' | 'EDIT'; column: CalculatedColumn<any, unknown>; row: any },
event: CellKeyboardEvent
) => {
- if (event.code === 'KeyC' && (event.metaKey || event.ctrlKey)) {
+ if (mode === 'SELECT' && event.code === 'KeyC' && (event.metaKey || event.ctrlKey)) {
const colKey = column.key
const cellValue = row[colKey] ?? ''
const value = formatClipboardValue(cellValue)
diff --git a/apps/studio/components/grid/components/grid/Grid.tsx b/apps/studio/components/grid/components/grid/Grid.tsx
index ffc35913bae..1818e82ebba 100644
--- a/apps/studio/components/grid/components/grid/Grid.tsx
+++ b/apps/studio/components/grid/components/grid/Grid.tsx
@@ -128,9 +128,7 @@ export const Grid = memo(
}
}
- const removeAllFilters = () => {
- onApplyFilters([])
- }
+ const removeAllFilters = () => onApplyFilters([])
return (
<div