@graphcommerce/framer-scroller 9.0.0-canary.78 → 9.0.0-canary.80

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,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0-canary.80
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2341](https://github.com/graphcommerce-org/graphcommerce/pull/2341) [`e01fd4a`](https://github.com/graphcommerce-org/graphcommerce/commit/e01fd4a933aa852e97ccfbee15378d8479e2b49f) - Prevent retriggering a scrollTo animation when the current scrollLeft/scrollTop is a float ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
8
+
9
+ ## 9.0.0-canary.79
10
+
3
11
  ## 9.0.0-canary.78
4
12
 
5
13
  ## 9.0.0-canary.77
@@ -33,7 +33,12 @@ export function useScrollTo() {
33
33
  to = incoming
34
34
  }
35
35
 
36
- if (process.env.NODE_ENV === 'development' && scroll.animating.get() && __retrigger === 0) {
36
+ if (
37
+ process.env.NODE_ENV === 'development' &&
38
+ scroll.animating.get() &&
39
+ __retrigger === 0 &&
40
+ (Math.round(ref.scrollLeft) !== to.x || Math.round(ref.scrollTop) !== to.y)
41
+ ) {
37
42
  console.warn(
38
43
  `scrollTo triggered while another animation is in progress. This cancels the current animation and creates a new one.`,
39
44
  )
@@ -55,7 +60,7 @@ export function useScrollTo() {
55
60
  const stop: { stop: () => void }[] = []
56
61
 
57
62
  const xDone = new Promise<void>((onComplete) => {
58
- if (ref.scrollLeft !== to.x) {
63
+ if (Math.round(ref.scrollLeft) !== to.x) {
59
64
  disableSnap(stopAnimationOnScroll)
60
65
  if (!stopAnimationOnScroll) ref.style.overflow = 'hidden'
61
66
 
@@ -77,7 +82,7 @@ export function useScrollTo() {
77
82
  })
78
83
 
79
84
  const yDone = new Promise<void>((onComplete) => {
80
- if (ref.scrollTop !== to.y) {
85
+ if (Math.round(ref.scrollTop) !== to.y) {
81
86
  disableSnap(stopAnimationOnScroll)
82
87
  if (!stopAnimationOnScroll) ref.style.overflow = 'hidden'
83
88
 
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": "9.0.0-canary.78",
5
+ "version": "9.0.0-canary.80",
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": "^9.0.0-canary.78",
22
- "@graphcommerce/framer-utils": "^9.0.0-canary.78",
23
- "@graphcommerce/image": "^9.0.0-canary.78",
24
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.78",
25
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.78",
21
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.80",
22
+ "@graphcommerce/framer-utils": "^9.0.0-canary.80",
23
+ "@graphcommerce/image": "^9.0.0-canary.80",
24
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.80",
25
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.80",
26
26
  "@lingui/core": "^4.2.1",
27
27
  "@lingui/react": "^4.2.1",
28
28
  "@mui/material": "^5.10.16",