mirror of
https://github.com/immich-app/immich.git
synced 2024-12-27 10:58:13 +02:00
chore(web): ignore shortcut toggle when entering email and password (#12082)
This commit is contained in:
parent
16d5996f77
commit
aac6a4b052
@ -20,7 +20,7 @@ export const shouldIgnoreShortcut = (event: KeyboardEvent): boolean => {
|
||||
return false;
|
||||
}
|
||||
const type = (event.target as HTMLInputElement).type;
|
||||
return ['textarea', 'text', 'date', 'datetime-local'].includes(type);
|
||||
return ['textarea', 'text', 'date', 'datetime-local', 'email', 'password'].includes(type);
|
||||
};
|
||||
|
||||
export const matchesShortcut = (event: KeyboardEvent, shortcut: Shortcut) => {
|
||||
@ -53,7 +53,6 @@ export const shortcuts = <T extends HTMLElement>(
|
||||
): ActionReturn<ShortcutOptions<T>[]> => {
|
||||
function onKeydown(event: KeyboardEvent) {
|
||||
const ignoreShortcut = shouldIgnoreShortcut(event);
|
||||
|
||||
for (const { shortcut, onShortcut, ignoreInputFields = true, preventDefault = true } of options) {
|
||||
if (ignoreInputFields && ignoreShortcut) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user