@onekeyfe/react-native-native-list 6.7.0-5 → 6.7.0-6
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/docs/SPEC.md +9 -0
- package/lib/module/NativeList.web.js +6 -1
- package/package.json +3 -3
- package/src/NativeList.web.tsx +9 -1
package/docs/SPEC.md
CHANGED
|
@@ -1193,3 +1193,12 @@ presentation, including clearing omitted radius/contentFit/shape overrides.
|
|
|
1193
1193
|
Presentation wrapper changes move the existing nodes and preserve asynchronous
|
|
1194
1194
|
loading/error visibility; they do not recreate or reload an unchanged source.
|
|
1195
1195
|
Changing the source set retains the existing rebuild/disposal behavior.
|
|
1196
|
+
|
|
1197
|
+
### Web slot-list scroll ownership
|
|
1198
|
+
|
|
1199
|
+
When container slots create an owned Web scroll host without `webScrollHost`,
|
|
1200
|
+
that actual host exposes the existing `data-collapsible-pager-scroll` marker.
|
|
1201
|
+
A containing Web pager therefore applies insets, collapse/top commands and route
|
|
1202
|
+
restoration to the owned host, with slot content as its padding target. The
|
|
1203
|
+
ordinary no-slot viewport and explicit external-host paths keep their existing
|
|
1204
|
+
ownership; no Pager dependency or new API is required.
|
|
@@ -263,8 +263,13 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
263
263
|
const setBoundsRef = useCallback(value => {
|
|
264
264
|
setContentBounds(value);
|
|
265
265
|
}, []);
|
|
266
|
+
const ownedScrollElementRef = useRef(null);
|
|
266
267
|
const setScrollHostRef = useCallback(value => {
|
|
267
|
-
|
|
268
|
+
const element = value;
|
|
269
|
+
if (ownedScrollElementRef.current !== element) ownedScrollElementRef.current?.removeAttribute('data-collapsible-pager-scroll');
|
|
270
|
+
element?.setAttribute('data-collapsible-pager-scroll', 'true');
|
|
271
|
+
ownedScrollElementRef.current = element;
|
|
272
|
+
setOwnedScrollHost(element);
|
|
268
273
|
}, []);
|
|
269
274
|
if (!useSlotLayout) return /*#__PURE__*/_jsx(View, {
|
|
270
275
|
...viewProps,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-native-list",
|
|
3
|
-
"version": "6.7.0-
|
|
3
|
+
"version": "6.7.0-6",
|
|
4
4
|
"description": "Template-driven native RecyclerView and UICollectionView for React Native",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"typescript": "^5.9.2"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@onekeyfe/react-native-image": "6.7.0-
|
|
90
|
-
"@onekeyfe/react-native-native-logger": "6.7.0-
|
|
89
|
+
"@onekeyfe/react-native-image": "6.7.0-6",
|
|
90
|
+
"@onekeyfe/react-native-native-logger": "6.7.0-6",
|
|
91
91
|
"react": "*",
|
|
92
92
|
"react-native": "*",
|
|
93
93
|
"react-native-nitro-modules": "0.37.0"
|
package/src/NativeList.web.tsx
CHANGED
|
@@ -436,9 +436,17 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
|
|
|
436
436
|
},
|
|
437
437
|
[]
|
|
438
438
|
);
|
|
439
|
+
const ownedScrollElementRef = useRef<HTMLElement | null>(null);
|
|
439
440
|
const setScrollHostRef = useCallback(
|
|
440
441
|
(value: React.ComponentRef<typeof View> | null) => {
|
|
441
|
-
|
|
442
|
+
const element = value as unknown as HTMLElement | null;
|
|
443
|
+
if (ownedScrollElementRef.current !== element)
|
|
444
|
+
ownedScrollElementRef.current?.removeAttribute(
|
|
445
|
+
'data-collapsible-pager-scroll'
|
|
446
|
+
);
|
|
447
|
+
element?.setAttribute('data-collapsible-pager-scroll', 'true');
|
|
448
|
+
ownedScrollElementRef.current = element;
|
|
449
|
+
setOwnedScrollHost(element);
|
|
442
450
|
},
|
|
443
451
|
[]
|
|
444
452
|
);
|