cmd+backspace for delete rows on mac

This commit is contained in:
Jan Prochazka 2022-04-21 17:44:00 +02:00
parent 5315a549b0
commit 66da21804b
3 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,8 @@
if (e.altKey) keyText += 'Alt+';
keyText += e.key;
// console.log('keyText', keyText);
const commandsValue = get(commandsCustomized);
let commandsFiltered: any = Object.values(commandsValue).filter(
(x: any) =>

View File

@ -35,7 +35,7 @@
category: 'Data grid',
name: 'Delete selected rows',
toolbarName: 'Delete row(s)',
keyText: 'CtrlOrCommand+Delete',
keyText: isMac() ? 'Command+Backspace' : 'CtrlOrCommand+Delete',
icon: 'icon minus',
testEnabled: () => getCurrentDataGrid()?.getGrider()?.editable,
onClick: () => getCurrentDataGrid().deleteSelectedRows(),

View File

@ -53,7 +53,8 @@ export function formatKeyText(keyText: string): string {
.replace('Shift+', '⇧ ')
.replace('Alt+', '⌥ ')
.replace('Command+', '⌘ ')
.replace('Ctrl+', '⌃ ');
.replace('Ctrl+', '⌃ ')
.replace('Backspace', '⌫ ');
}
return keyText.replace('CtrlOrCommand+', 'Ctrl+');
}