@14ch/svelte-ui 0.0.63 → 0.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -103,18 +103,20 @@
|
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
$effect(() => {
|
|
106
|
-
if (!
|
|
106
|
+
if (!dialogRef) return;
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
// showModal() した dialog は最前面の1つだけに cancel が配送されるため、
|
|
109
|
+
// Escape で多重の Modal がまとめて閉じることを防げる。ネイティブの即時
|
|
110
|
+
// クローズは抑止し、fade-out アニメーション付きの close() を使う。
|
|
111
|
+
const handleCancel = (event: Event) => {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
close();
|
|
112
114
|
};
|
|
113
115
|
|
|
114
|
-
|
|
116
|
+
dialogRef.addEventListener('cancel', handleCancel);
|
|
115
117
|
|
|
116
118
|
return () => {
|
|
117
|
-
|
|
119
|
+
dialogRef.removeEventListener('cancel', handleCancel);
|
|
118
120
|
};
|
|
119
121
|
});
|
|
120
122
|
|