@primer/react 0.0.0-20260220141131 → 0.0.0-20260220144011
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,11 +1,13 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260220144011
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Fake entry to force publishing
|
|
8
8
|
|
|
9
|
+
- [#7547](https://github.com/primer/react/pull/7547) [`36ee7ce`](https://github.com/primer/react/commit/36ee7ce5d5fd074e137d11338d6b852721130d29) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useScrollFlash): defer scroll read/write to requestAnimationFrame to avoid forced reflow
|
|
10
|
+
|
|
9
11
|
## 38.13.0
|
|
10
12
|
|
|
11
13
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollFlash.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollFlash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"useScrollFlash.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollFlash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,QAoB7F"}
|
|
@@ -15,11 +15,13 @@ function useScrollFlash(scrollContainerRef) {
|
|
|
15
15
|
if (!scrollContainer) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const id = requestAnimationFrame(() => {
|
|
19
|
+
const currentScroll = scrollContainer.scrollTop;
|
|
20
|
+
const altScroll = currentScroll < 1 ? currentScroll + 1 : currentScroll - 1;
|
|
21
|
+
scrollContainer.scrollTop = altScroll;
|
|
22
|
+
scrollContainer.scrollTop = currentScroll;
|
|
23
|
+
});
|
|
24
|
+
return () => cancelAnimationFrame(id);
|
|
23
25
|
};
|
|
24
26
|
t1 = [scrollContainerRef];
|
|
25
27
|
$[0] = scrollContainerRef;
|
package/package.json
CHANGED