@kaizen/components 2.0.3 → 2.0.5

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.
@@ -60,10 +60,14 @@ var ListBox = function (_a) {
60
60
  var optionKey = getOptionKeyFromCollection(state);
61
61
  var focusToElement = safeQuerySelector("[data-key='".concat(optionKey, "']"));
62
62
  if (focusToElement) {
63
- focusToElement.focus();
63
+ focusToElement.focus({
64
+ preventScroll: true
65
+ });
64
66
  } else {
65
67
  // If an element is not found, focus on the listbox. This ensures the list can still be navigated to via keyboard if the keys do not align to the data attributes of the list items.
66
- (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
68
+ (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus({
69
+ preventScroll: true
70
+ });
67
71
  }
68
72
  }
69
73
  // Only run this effect for checking the first successful render
@@ -52,10 +52,14 @@ const ListBox = /*#__PURE__*/function () {
52
52
  var optionKey = getOptionKeyFromCollection(state);
53
53
  var focusToElement = safeQuerySelector("[data-key='".concat(optionKey, "']"));
54
54
  if (focusToElement) {
55
- focusToElement.focus();
55
+ focusToElement.focus({
56
+ preventScroll: true
57
+ });
56
58
  } else {
57
59
  // If an element is not found, focus on the listbox. This ensures the list can still be navigated to via keyboard if the keys do not align to the data attributes of the list items.
58
- (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
60
+ (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus({
61
+ preventScroll: true
62
+ });
59
63
  }
60
64
  }
61
65
  // Only run this effect for checking the first successful render
package/dist/styles.css CHANGED
@@ -11484,10 +11484,6 @@
11484
11484
  }
11485
11485
 
11486
11486
  @layer kz-components {
11487
- ul {
11488
- padding-inline-start: 0;
11489
- }
11490
-
11491
11487
  .ListItem-module_listItem__xGr6A {
11492
11488
  font-family: var(--typography-paragraph-body-font-family);
11493
11489
  font-weight: var(--typography-paragraph-body-font-weight);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/components",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "Kaizen component library",
5
5
  "author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
6
6
  "homepage": "https://cultureamp.design",
@@ -70,10 +70,10 @@ export const ListBox = <Option extends SingleSelectOption>({
70
70
  const focusToElement = safeQuerySelector(`[data-key='${optionKey}']`)
71
71
 
72
72
  if (focusToElement) {
73
- focusToElement.focus()
73
+ focusToElement.focus({ preventScroll: true })
74
74
  } else {
75
75
  // If an element is not found, focus on the listbox. This ensures the list can still be navigated to via keyboard if the keys do not align to the data attributes of the list items.
76
- ref.current?.focus()
76
+ ref.current?.focus({ preventScroll: true })
77
77
  }
78
78
  }
79
79
  // Only run this effect for checking the first successful render
@@ -1,8 +1,4 @@
1
1
  @layer kz-components {
2
- ul {
3
- padding-inline-start: 0;
4
- }
5
-
6
2
  .listItem {
7
3
  font-family: var(--typography-paragraph-body-font-family);
8
4
  font-weight: var(--typography-paragraph-body-font-weight);