mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(web): consistent modal escape behavior (#7677)
* fix(web): consistent modal escape behavior * make onClose optional
This commit is contained in:
parent
3da2b05428
commit
5dd11ca17a
39 changed files with 111 additions and 123 deletions
|
|
@ -158,8 +158,8 @@
|
|||
<ConfirmDialogue
|
||||
title="Merge people"
|
||||
confirmText="Merge"
|
||||
on:confirm={handleMerge}
|
||||
on:cancel={() => (isShowConfirmation = false)}
|
||||
onConfirm={handleMerge}
|
||||
onClose={() => (isShowConfirmation = false)}
|
||||
>
|
||||
<svelte:fragment slot="prompt">
|
||||
<p>Are you sure you want merge these people ?</p></svelte:fragment
|
||||
|
|
|
|||
|
|
@ -23,15 +23,6 @@
|
|||
close: void;
|
||||
}>();
|
||||
|
||||
const handleKeyboardPress = (event: KeyboardEvent) => {
|
||||
switch (event.key) {
|
||||
case 'Escape': {
|
||||
dispatch('close');
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const changePersonToMerge = (newperson: PersonResponseDto) => {
|
||||
const index = potentialMergePeople.indexOf(newperson);
|
||||
[potentialMergePeople[index], personMerge2] = [personMerge2, potentialMergePeople[index]];
|
||||
|
|
@ -39,9 +30,7 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
<svelte:document on:keypress={handleKeyboardPress} />
|
||||
|
||||
<FullScreenModal on:clickOutside={() => dispatch('close')}>
|
||||
<FullScreenModal onClose={() => dispatch('close')}>
|
||||
<div class="flex h-full w-full place-content-center place-items-center overflow-hidden">
|
||||
<div
|
||||
class="w-[250px] max-w-[125vw] rounded-3xl border bg-immich-bg shadow-sm dark:border-immich-dark-gray dark:bg-immich-dark-gray dark:text-immich-dark-fg md:w-[375px]"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
<FullScreenModal on:clickOutside={() => handleCancel()}>
|
||||
<FullScreenModal onClose={handleCancel}>
|
||||
<div
|
||||
class="w-[500px] max-w-[95vw] rounded-3xl border bg-immich-bg p-4 py-8 shadow-sm dark:border-immich-dark-gray dark:bg-immich-dark-gray dark:text-immich-dark-fg"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue