Fixed global hotkey conflict in inputs (#13209)
This PR fixes a focus conflict with global hotkeys, mainly "?" that opens the shortcut helper dialog. This fix works but we should maybe think about a more generic approach in another issue, like disabling global hotkeys when certain types of components are open (input, dropdown, etc.) Fixes https://github.com/twentyhq/twenty/issues/13197 --------- Co-authored-by: bosiraphael <raphael.bosi@gmail.com> Co-authored-by: Raphaël Bosi <71827178+bosiraphael@users.noreply.github.com>
This commit is contained in:
@@ -7,13 +7,19 @@ import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
type UseHotkeysOptionsWithoutBuggyOptions = Omit<Options, 'enabled'>;
|
||||
|
||||
export const useGlobalHotkeys = (
|
||||
keys: Keys,
|
||||
callback: HotkeyCallback,
|
||||
containsModifier: boolean,
|
||||
dependencies?: unknown[],
|
||||
options?: UseHotkeysOptionsWithoutBuggyOptions,
|
||||
) => {
|
||||
export const useGlobalHotkeys = ({
|
||||
keys,
|
||||
callback,
|
||||
containsModifier,
|
||||
dependencies,
|
||||
options,
|
||||
}: {
|
||||
keys: Keys;
|
||||
callback: HotkeyCallback;
|
||||
containsModifier: boolean;
|
||||
dependencies?: unknown[];
|
||||
options?: UseHotkeysOptionsWithoutBuggyOptions;
|
||||
}) => {
|
||||
const callGlobalHotkeysCallback = useGlobalHotkeysCallback(dependencies);
|
||||
|
||||
const enableOnContentEditable = isDefined(options?.enableOnContentEditable)
|
||||
|
||||
Reference in New Issue
Block a user