@codeleap/web 3.12.11 → 3.12.14
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
|
@@ -58,6 +58,7 @@ export type ModalProps =
|
|
|
58
58
|
withScrollContainer?: boolean
|
|
59
59
|
scrollLocked?: boolean
|
|
60
60
|
backdropProps?: Partial<TouchableProps>
|
|
61
|
+
alterHistory?: boolean
|
|
61
62
|
} & ComponentVariants<typeof ModalPresets> & ComponentCommonProps
|
|
62
63
|
|
|
63
64
|
function focusModal(event: FocusEvent, id: string) {
|
|
@@ -179,6 +180,7 @@ export const ModalContent = (
|
|
|
179
180
|
debugName,
|
|
180
181
|
scrollLocked,
|
|
181
182
|
backdropProps = {},
|
|
183
|
+
alterHistory = false,
|
|
182
184
|
...props
|
|
183
185
|
} = modalProps
|
|
184
186
|
|
|
@@ -192,7 +194,10 @@ export const ModalContent = (
|
|
|
192
194
|
|
|
193
195
|
const toggleAndReturn = () => {
|
|
194
196
|
toggle?.()
|
|
195
|
-
|
|
197
|
+
|
|
198
|
+
if (alterHistory) {
|
|
199
|
+
window.history.back()
|
|
200
|
+
}
|
|
196
201
|
|
|
197
202
|
if (TypeGuards.isFunction(onClose)) onClose()
|
|
198
203
|
}
|
|
@@ -245,11 +250,11 @@ export const ModalContent = (
|
|
|
245
250
|
/>
|
|
246
251
|
|
|
247
252
|
<ModalArea css={variantStyles.innerWrapper}>
|
|
248
|
-
<Touchable
|
|
249
|
-
css={variantStyles.backdropPressable}
|
|
250
|
-
onPress={close}
|
|
251
|
-
debounce={1000}
|
|
252
|
-
{...backdropProps}
|
|
253
|
+
<Touchable
|
|
254
|
+
css={variantStyles.backdropPressable}
|
|
255
|
+
onPress={close}
|
|
256
|
+
debounce={1000}
|
|
257
|
+
{...backdropProps}
|
|
253
258
|
/>
|
|
254
259
|
<View
|
|
255
260
|
component='section'
|
|
@@ -329,8 +334,10 @@ export const Modal = (props) => {
|
|
|
329
334
|
|
|
330
335
|
if (visible) {
|
|
331
336
|
document.body.style.overflow = 'hidden'
|
|
337
|
+
document.body.style.overflowX = 'hidden'
|
|
332
338
|
} else {
|
|
333
339
|
document.body.style.overflow = 'visible'
|
|
340
|
+
document.body.style.overflowX = 'hidden'
|
|
334
341
|
}
|
|
335
342
|
}, [visible])
|
|
336
343
|
|