@snack-uikit/list 0.21.3 → 0.21.4-preview-532f4f48.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.
@@ -100,7 +100,9 @@ exports.ListPrivate = (0, react_1.forwardRef)((_a, ref) => {
100
100
  const onScrollInitialized = () => {
101
101
  var _a, _b;
102
102
  if (scrollToSelectedItem) {
103
- (_b = (_a = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.itemRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.scrollIntoView();
103
+ (_b = (_a = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.itemRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.scrollIntoView({
104
+ block: 'center'
105
+ });
104
106
  }
105
107
  };
106
108
  const listJSX = (0, jsx_runtime_1.jsxs)("ul", Object.assign({
@@ -35,7 +35,7 @@ export const ListPrivate = forwardRef((_a, ref) => {
35
35
  const onScrollInitialized = () => {
36
36
  var _a, _b;
37
37
  if (scrollToSelectedItem) {
38
- (_b = (_a = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.itemRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.scrollIntoView();
38
+ (_b = (_a = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.itemRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ block: 'center' });
39
39
  }
40
40
  };
41
41
  const listJSX = (_jsxs("ul", Object.assign({ className: cn(commonStyles.listContainer, className), ref: ref, onKeyDown: onKeyDown, tabIndex: tabIndex, onFocus: onFocus, onBlur: onBlur, "data-active": active || undefined, role: 'menu' }, extractSupportProps(props), { children: [(Number(pinTop === null || pinTop === void 0 ? void 0 : pinTop.length) > 0 || search) && (_jsxs(PinTopGroupItem, { children: [search && _jsx(SearchItem, Object.assign({ search: search }, searchItem)), Number(pinTop === null || pinTop === void 0 ? void 0 : pinTop.length) > 0 && itemsPinTopJSX] })), scroll ? (_jsxs(Scroll, { className: cn({
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "List",
7
- "version": "0.21.3",
7
+ "version": "0.21.4-preview-532f4f48.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -53,5 +53,5 @@
53
53
  "peerDependencies": {
54
54
  "@snack-uikit/locale": "*"
55
55
  },
56
- "gitHead": "298730a8d2430c091ba850a0b7d9c5f3a5f9cfcc"
56
+ "gitHead": "37b529bffb25e45cdec299b61be5a93d1c53d01f"
57
57
  }
@@ -93,7 +93,7 @@ export const ListPrivate = forwardRef(
93
93
 
94
94
  const onScrollInitialized = () => {
95
95
  if (scrollToSelectedItem) {
96
- (selectedItem as FlattenBaseItem)?.itemRef?.current?.scrollIntoView();
96
+ (selectedItem as FlattenBaseItem)?.itemRef?.current?.scrollIntoView({ block: 'center' });
97
97
  }
98
98
  };
99
99