From deef10559ccea536f8b4f0b3931d4a29b315181d Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Fri, 8 Nov 2024 16:35:49 +0100 Subject: [PATCH] feat: implement quick key Ctrl+D to duplicate the current row in table mode --- src/lib/components/modes/tablemode/TableMode.svelte | 3 +-- .../modes/tablemode/contextmenu/createTableContextMenuItems.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/components/modes/tablemode/TableMode.svelte b/src/lib/components/modes/tablemode/TableMode.svelte index d1e14ebf..b139776c 100644 --- a/src/lib/components/modes/tablemode/TableMode.svelte +++ b/src/lib/components/modes/tablemode/TableMode.svelte @@ -1210,8 +1210,7 @@ if (combo === 'Ctrl+D') { event.preventDefault() - // handleDuplicate() - // TODO: implement duplicate + handleDuplicateRow() } if (combo === 'Delete' || combo === 'Backspace') { event.preventDefault() diff --git a/src/lib/components/modes/tablemode/contextmenu/createTableContextMenuItems.ts b/src/lib/components/modes/tablemode/contextmenu/createTableContextMenuItems.ts index 6e6bb9fa..58771919 100644 --- a/src/lib/components/modes/tablemode/contextmenu/createTableContextMenuItems.ts +++ b/src/lib/components/modes/tablemode/contextmenu/createTableContextMenuItems.ts @@ -201,7 +201,7 @@ export default function ({ onClick: () => onDuplicateRow(), icon: faClone, text: 'Duplicate row', - title: 'Duplicate the current row', + title: 'Duplicate the current row (Ctrl+D)', disabled: readOnly || !hasSelection || !hasJson }, {