mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-27 10:08:44 +00:00
[UI] Add form submission shortcut (#12328)
- Ctrl + enter submits the form
This commit is contained in:
1 parent
75f6960782
commit
8e555f6b37
3 files changed
+31
-2
No files matched your search
@@ -17,7 +17,10 @@ export type InvenTreeHotkeyItem = [
|
||||
HotkeyItemOptions?
|
||||
];
|
||||
|
||||
export function useInvenTreeHotkeys(_keys: InvenTreeHotkeyItem[]) {
|
||||
export function useInvenTreeHotkeys(
|
||||
_keys: InvenTreeHotkeyItem[],
|
||||
tagsToIgnore?: string[]
|
||||
) {
|
||||
const keyelems: [string, string][] = _keys.map(([key, description]) => [
|
||||
key,
|
||||
description
|
||||
@@ -29,7 +32,7 @@ export function useInvenTreeHotkeys(_keys: InvenTreeHotkeyItem[]) {
|
||||
HotkeyItemOptions?
|
||||
][] = _keys.map(([key, _, handler, options]) => [key, handler, options]);
|
||||
// Register the hotkeys using the Mantine hook
|
||||
useHotkeys(mappedHotkeys);
|
||||
useHotkeys(mappedHotkeys, tagsToIgnore);
|
||||
|
||||
// register to helper state to store hotkeys
|
||||
// This allows us to display the hotkeys in the UI
|
||||
|
||||
Reference in new issue
Block a user