fix(web): consistent modal escape behavior (#7677)

* fix(web): consistent modal escape behavior

* make onClose optional
This commit is contained in:
Michel Heusschen 2024-03-07 04:18:53 +01:00 committed by GitHub
parent 3da2b05428
commit 5dd11ca17a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 111 additions and 123 deletions

View file

@ -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

View file

@ -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]"

View file

@ -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"
>