@playpilot/tpi 6.0.0 → 6.0.1-beta.1
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
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { mobileBreakpoint } from '$lib/constants'
|
|
10
10
|
import { destroyAllModals, getPreviousModal, goBackToPreviousModal } from '$lib/modal'
|
|
11
11
|
import { focustrap } from '$lib/actions/focustrap'
|
|
12
|
+
import { getScrollRoot } from '$lib/scroll'
|
|
12
13
|
|
|
13
14
|
interface Props {
|
|
14
15
|
children: Snippet
|
|
@@ -52,8 +53,9 @@
|
|
|
52
53
|
setContext('scope', 'modal')
|
|
53
54
|
|
|
54
55
|
onMount(() => {
|
|
55
|
-
const
|
|
56
|
-
|
|
56
|
+
const scrollElement = getScrollRoot()
|
|
57
|
+
const baseOverflowStyle = scrollElement.style.overflowY
|
|
58
|
+
scrollElement.style.overflowY = 'hidden'
|
|
57
59
|
|
|
58
60
|
hasPreviousModal = !!getPreviousModal()
|
|
59
61
|
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
requestAnimationFrame(setInitialScrollPosition)
|
|
65
67
|
|
|
66
68
|
return () => {
|
|
67
|
-
|
|
69
|
+
scrollElement.style.overflowY = baseOverflowStyle || ''
|
|
68
70
|
|
|
69
71
|
// Remove the modal entry from above from the browser history. This is done only once for the entire stack.
|
|
70
72
|
// We check for getPreviousModal not because we really care about the previous modal, but to check if all
|