mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 01:11:16 +03:00
fix(web): improve focus and shortcuts (#7983)
* fix(web): improve focus and shortcuts * fix shiftKeyIsDown
This commit is contained in:
@@ -178,7 +178,7 @@
|
||||
{showArchiveIcon}
|
||||
{asset}
|
||||
{groupIndex}
|
||||
on:click={() => assetClickHandler(asset, groupAssets, groupTitle)}
|
||||
onClick={() => assetClickHandler(asset, groupAssets, groupTitle)}
|
||||
on:select={() => assetSelectHandler(asset, groupAssets, groupTitle)}
|
||||
on:mouse-event={() => assetMouseEventHandler(groupTitle, asset)}
|
||||
selected={$selectedAssets.has(asset) || $assetStore.albumAssets.has(asset.id)}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { isSearchEnabled } from '$lib/stores/search.store';
|
||||
import { featureFlags } from '$lib/stores/server-config.store';
|
||||
import { deleteAssets } from '$lib/utils/actions';
|
||||
import { shortcuts, type ShortcutOptions } from '$lib/utils/shortcut';
|
||||
import { shortcuts, type ShortcutOptions, matchesShortcut } from '$lib/utils/shortcut';
|
||||
import { formatGroupTitle, splitBucketIntoDateGroups } from '$lib/utils/timeline-util';
|
||||
import type { AlbumResponseDto, AssetResponseDto } from '@immich/sdk';
|
||||
import { DateTime } from 'luxon';
|
||||
@@ -202,24 +202,24 @@
|
||||
|
||||
let shiftKeyIsDown = false;
|
||||
|
||||
const onKeyDown = (e: KeyboardEvent) => {
|
||||
const onKeyDown = (event: KeyboardEvent) => {
|
||||
if ($isSearchEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.key == 'Shift') {
|
||||
e.preventDefault();
|
||||
if (matchesShortcut(event, { key: 'Shift' })) {
|
||||
event.preventDefault();
|
||||
shiftKeyIsDown = true;
|
||||
}
|
||||
};
|
||||
|
||||
const onKeyUp = (e: KeyboardEvent) => {
|
||||
const onKeyUp = (event: KeyboardEvent) => {
|
||||
if ($isSearchEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.key == 'Shift') {
|
||||
e.preventDefault();
|
||||
if (matchesShortcut(event, { key: 'Shift' })) {
|
||||
event.preventDefault();
|
||||
shiftKeyIsDown = false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user