@dust-tt/sparkle 0.2.191 → 0.2.192
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.
package/package.json
CHANGED
package/src/components/Modal.tsx
CHANGED
|
@@ -128,7 +128,12 @@ export function Modal({
|
|
|
128
128
|
<Dialog
|
|
129
129
|
as="div"
|
|
130
130
|
className="s-fixed s-absolute s-inset-0 s-z-50 s-overflow-hidden"
|
|
131
|
-
onClose={
|
|
131
|
+
onClose={() => {
|
|
132
|
+
// We allow closing the modal by clicking outside of it only if there are no changes
|
|
133
|
+
if (!hasChanged) {
|
|
134
|
+
onClose();
|
|
135
|
+
}
|
|
136
|
+
}}
|
|
132
137
|
>
|
|
133
138
|
{/* Smoke screen and transition */}
|
|
134
139
|
<Transition.Child
|