@snack-uikit/list 0.29.6-preview-d65ce031.0 → 0.29.6-preview-2bc759a5.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.
|
@@ -111,18 +111,18 @@ exports.ListPrivate = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
111
111
|
if (selectedItemIndex < 0) {
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
setTimeout(() => {
|
|
115
115
|
virtualizer.scrollToIndex(selectedItemIndex, {
|
|
116
116
|
align: 'center'
|
|
117
117
|
});
|
|
118
|
-
|
|
118
|
+
setTimeout(() => {
|
|
119
119
|
var _a, _b;
|
|
120
120
|
const itemToScrollTo = memoizedFocusFlattenItems[selectedItemIndex];
|
|
121
121
|
(_b = (_a = itemToScrollTo === null || itemToScrollTo === void 0 ? void 0 : itemToScrollTo.itemRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.scrollIntoView({
|
|
122
122
|
block: 'center'
|
|
123
123
|
});
|
|
124
|
-
});
|
|
125
|
-
});
|
|
124
|
+
}, 0);
|
|
125
|
+
}, 0);
|
|
126
126
|
}
|
|
127
127
|
}, [selectedItemIndex, scroll, scrollToSelectedItem, virtualized, virtualizer, memoizedFocusFlattenItems]);
|
|
128
128
|
const loadingJSX = (0, react_1.useMemo)(() => loading && (0, jsx_runtime_1.jsx)("div", {
|
|
@@ -61,14 +61,14 @@ export const ListPrivate = forwardRef((_a, ref) => {
|
|
|
61
61
|
if (selectedItemIndex < 0) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
setTimeout(() => {
|
|
65
65
|
virtualizer.scrollToIndex(selectedItemIndex, { align: 'center' });
|
|
66
|
-
|
|
66
|
+
setTimeout(() => {
|
|
67
67
|
var _a, _b;
|
|
68
68
|
const itemToScrollTo = memoizedFocusFlattenItems[selectedItemIndex];
|
|
69
69
|
(_b = (_a = itemToScrollTo === null || itemToScrollTo === void 0 ? void 0 : itemToScrollTo.itemRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ block: 'center' });
|
|
70
|
-
});
|
|
71
|
-
});
|
|
70
|
+
}, 0);
|
|
71
|
+
}, 0);
|
|
72
72
|
}
|
|
73
73
|
}, [selectedItemIndex, scroll, scrollToSelectedItem, virtualized, virtualizer, memoizedFocusFlattenItems]);
|
|
74
74
|
const loadingJSX = useMemo(() => loading && (_jsx("div", { role: 'spinbutton', tabIndex: -1, className: styles.loader, "data-size": size, "data-no-items": hasNoItems || undefined, "data-test-id": 'list__loader', children: _jsx(Spinner, { size: size === 'l' ? 's' : 'xs' }) })), [hasNoItems, loading, size]);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "List",
|
|
7
|
-
"version": "0.29.6-preview-
|
|
7
|
+
"version": "0.29.6-preview-2bc759a5.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@snack-uikit/locale": "*"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "9f2cb084807677cdd4c76d003d382d868943f948"
|
|
58
58
|
}
|
|
@@ -97,14 +97,14 @@ export const ListPrivate = forwardRef(
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
setTimeout(() => {
|
|
101
101
|
virtualizer.scrollToIndex(selectedItemIndex, { align: 'center' });
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
setTimeout(() => {
|
|
104
104
|
const itemToScrollTo = memoizedFocusFlattenItems[selectedItemIndex];
|
|
105
105
|
itemToScrollTo?.itemRef?.current?.scrollIntoView({ block: 'center' });
|
|
106
|
-
});
|
|
107
|
-
});
|
|
106
|
+
}, 0);
|
|
107
|
+
}, 0);
|
|
108
108
|
}
|
|
109
109
|
}, [selectedItemIndex, scroll, scrollToSelectedItem, virtualized, virtualizer, memoizedFocusFlattenItems]);
|
|
110
110
|
|