@tidbcloud/uikit 2.0.0-beta.46 → 2.0.0-beta.47
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
|
@@ -182,14 +182,15 @@ const usePickerScrollColumn = ({ min, max, curr, open, render }) => {
|
|
|
182
182
|
);
|
|
183
183
|
}, [numbers, handleClickCell, onScroll, curr, render, classes]);
|
|
184
184
|
const adjustScrollTop = ahooks.useMemoizedFn(() => {
|
|
185
|
+
var _a;
|
|
185
186
|
const i = numbers.findIndex((i2) => i2 === val);
|
|
186
|
-
if (i !== -1 && open
|
|
187
|
+
if (i !== -1 && open) {
|
|
187
188
|
const s = i * constant.CellHeight;
|
|
188
|
-
ref.current.scrollTo({ top: s, behavior: "auto" });
|
|
189
|
+
(_a = ref.current) == null ? void 0 : _a.scrollTo({ top: s, behavior: "auto" });
|
|
189
190
|
}
|
|
190
191
|
});
|
|
191
192
|
React.useEffect(() => {
|
|
192
|
-
|
|
193
|
+
requestIdleCallback(() => {
|
|
193
194
|
adjustScrollTop();
|
|
194
195
|
});
|
|
195
196
|
}, [open, val, adjustScrollTop]);
|
|
@@ -180,14 +180,15 @@ const usePickerScrollColumn = ({ min, max, curr, open, render }) => {
|
|
|
180
180
|
);
|
|
181
181
|
}, [numbers, handleClickCell, onScroll, curr, render, classes]);
|
|
182
182
|
const adjustScrollTop = useMemoizedFn(() => {
|
|
183
|
+
var _a;
|
|
183
184
|
const i = numbers.findIndex((i2) => i2 === val);
|
|
184
|
-
if (i !== -1 && open
|
|
185
|
+
if (i !== -1 && open) {
|
|
185
186
|
const s = i * CellHeight;
|
|
186
|
-
ref.current.scrollTo({ top: s, behavior: "auto" });
|
|
187
|
+
(_a = ref.current) == null ? void 0 : _a.scrollTo({ top: s, behavior: "auto" });
|
|
187
188
|
}
|
|
188
189
|
});
|
|
189
190
|
useEffect(() => {
|
|
190
|
-
|
|
191
|
+
requestIdleCallback(() => {
|
|
191
192
|
adjustScrollTop();
|
|
192
193
|
});
|
|
193
194
|
}, [open, val, adjustScrollTop]);
|