@graphcommerce/framer-scroller 6.2.0-canary.28 → 6.2.0-canary.29
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/CHANGELOG.md +2 -0
- package/components/ScrollerProvider.tsx +2 -23
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -115,30 +115,9 @@ export function ScrollerProvider(props: ScrollerProviderProps) {
|
|
|
115
115
|
const enableSnap = useCallback(() => {
|
|
116
116
|
if (snap.get() === true) return
|
|
117
117
|
if (scrollerRef.current) scrollerRef.current.style.scrollSnapType = ''
|
|
118
|
-
snap.set(true)
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* There is a bug in Firefox where the actual max scrollLeft isn't the same as the max measured
|
|
122
|
-
* bounds of the elements. If we do not exactly set the correct scrollLeft the scrollLeft is
|
|
123
|
-
* reset to 0 on firefox (instead of chrome/safari where it will snap to the nearest valid
|
|
124
|
-
* position).
|
|
125
|
-
*
|
|
126
|
-
* This can be checked by opening a LayoutOverlay.
|
|
127
|
-
*
|
|
128
|
-
* So we're setting a 'too big' scroll position by an arbitrary amount.
|
|
129
|
-
*
|
|
130
|
-
* To check if it works in a more recent version of FireFox:
|
|
131
|
-
*
|
|
132
|
-
* - Move `scroll.animating.set(false)` outside the requestAnimationFrame
|
|
133
|
-
* - Remove `scrollerRef.current.scrollLeft = prev + 10`
|
|
134
|
-
*/
|
|
135
|
-
const prev = scroll.x.get()
|
|
136
|
-
requestAnimationFrame(() => {
|
|
137
|
-
if (scrollerRef.current && Math.round(scrollerRef.current.scrollLeft) !== prev)
|
|
138
|
-
scrollerRef.current.scrollLeft = prev + 10
|
|
139
118
|
|
|
140
|
-
|
|
141
|
-
|
|
119
|
+
snap.set(true)
|
|
120
|
+
scroll.animating.set(false)
|
|
142
121
|
}, [snap, scroll])
|
|
143
122
|
|
|
144
123
|
useObserveItems(scrollerRef, items)
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/framer-scroller",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.29",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "tsc -W"
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"popmotion": "11.0.5",
|
|
19
|
-
"@graphcommerce/framer-utils": "6.2.0-canary.
|
|
20
|
-
"@graphcommerce/image": "6.2.0-canary.
|
|
19
|
+
"@graphcommerce/framer-utils": "6.2.0-canary.29",
|
|
20
|
+
"@graphcommerce/image": "6.2.0-canary.29"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.
|
|
24
|
-
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.
|
|
25
|
-
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.
|
|
23
|
+
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.29",
|
|
24
|
+
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.29",
|
|
25
|
+
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.29"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@mui/material": "^5.10.16",
|