fix(web): escape key to clear selection and go to previous page (#15142) (#15219)

This commit is contained in:
Jin Xuan
2025-01-10 23:27:35 +08:00
committed by GitHub
parent f9db60f25b
commit 3030e74fc3
5 changed files with 48 additions and 5 deletions
@@ -87,6 +87,13 @@
}
};
const handleEscape = () => {
if (assetInteraction.selectionActive) {
assetInteraction.clearMultiselect();
return;
}
};
onDestroy(() => {
assetStore.destroy();
});
@@ -122,7 +129,7 @@
</div>
{/snippet}
<AssetGrid enableRouting={true} {assetStore} {assetInteraction}>
<AssetGrid enableRouting={true} {assetStore} {assetInteraction} onEscape={handleEscape}>
<p class="font-medium text-gray-500/60 dark:text-gray-300/60 p-4">
{$t('trashed_items_will_be_permanently_deleted_after', { values: { days: $serverConfig.trashDays } })}
</p>