@graphcommerce/framer-scroller 8.0.3 → 8.0.4-canary.0

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.0.4-canary.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2225](https://github.com/graphcommerce-org/graphcommerce/pull/2225) [`29407d2`](https://github.com/graphcommerce-org/graphcommerce/commit/29407d28c4f7c2629f8c5ead658bfb203f5d81cf) - Fixed a bug on Firefox in which all overlays would retrigger the scrollTo function on opening or closing.
8
+ ([@mikekeehnen](https://github.com/mikekeehnen))
9
+
3
10
  ## 8.0.3
4
11
 
5
12
  ### Patch Changes
@@ -108,9 +108,13 @@ export function useScrollTo() {
108
108
 
109
109
  if (Array.isArray(incoming)) {
110
110
  const checkPositions = getScrollSnapPositions()
111
- if (checkPositions.x[incoming[0]] !== to.x || checkPositions.y[incoming[1]] !== to.y)
112
- await scrollTo(incoming, options, __retrigger + 1)
111
+ // We check if the value is close enough, since firefox does not round in whole pixels. Values in in`to` could be > 0 but < 1
112
+ const closeEnoughX = checkPositions.x.some((x) => Math.abs(x - to.x) <= 1)
113
+ const closeEnoughY = checkPositions.y.some((y) => Math.abs(y - to.y) <= 1)
114
+
115
+ if (!closeEnoughX || !closeEnoughY) await scrollTo(incoming, options, __retrigger + 1)
113
116
  }
117
+
114
118
  enableSnap()
115
119
  },
116
120
  [scrollerRef, enableSnap, getScrollSnapPositions, disableSnap, register, scroll, duration],
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": "8.0.3",
5
+ "version": "8.0.4-canary.0",
6
6
  "sideEffects": false,
7
7
  "scripts": {
8
8
  "dev": "tsc -W"
@@ -18,11 +18,11 @@
18
18
  "popmotion": "11.0.5"
19
19
  },
20
20
  "peerDependencies": {
21
- "@graphcommerce/eslint-config-pwa": "^8.0.3",
22
- "@graphcommerce/framer-utils": "^8.0.3",
23
- "@graphcommerce/image": "^8.0.3",
24
- "@graphcommerce/prettier-config-pwa": "^8.0.3",
25
- "@graphcommerce/typescript-config-pwa": "^8.0.3",
21
+ "@graphcommerce/eslint-config-pwa": "^8.0.4-canary.0",
22
+ "@graphcommerce/framer-utils": "^8.0.4-canary.0",
23
+ "@graphcommerce/image": "^8.0.4-canary.0",
24
+ "@graphcommerce/prettier-config-pwa": "^8.0.4-canary.0",
25
+ "@graphcommerce/typescript-config-pwa": "^8.0.4-canary.0",
26
26
  "@lingui/core": "^4.2.1",
27
27
  "@lingui/react": "^4.2.1",
28
28
  "@mui/material": "^5.10.16",