@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dust-tt/sparkle",
3
- "version": "0.2.191",
3
+ "version": "0.2.192",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && rollup -c",
6
6
  "build:with-tw-base": "rollup -c --environment INCLUDE_TW_BASE:true",
@@ -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={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