@codeleap/web 3.12.13 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/web",
3
- "version": "3.12.13",
3
+ "version": "3.12.14",
4
4
  "main": "src/index.ts",
5
5
  "repository": {
6
6
  "url": "https://github.com/codeleap-uk/internal-libs-monorepo.git",
@@ -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
- window.history.back()
197
+
198
+ if (alterHistory) {
199
+ window.history.back()
200
+ }
196
201
 
197
202
  if (TypeGuards.isFunction(onClose)) onClose()
198
203
  }
@@ -329,6 +334,7 @@ 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'
334
340
  document.body.style.overflowX = 'hidden'