@momentum-design/components 0.134.17 → 0.134.18

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.
@@ -605,9 +605,13 @@ class SpatialNavigationProvider extends Provider {
605
605
  const root = elementWithDataset.getRootNode();
606
606
  const nextElement = (_a = root === null || root === void 0 ? void 0 : root.getElementById(nextElementSelector)) !== null && _a !== void 0 ? _a : root === null || root === void 0 ? void 0 : root.querySelector(nextElementSelector);
607
607
  if (nextElement) {
608
- const isNextElementInFocusables = focusableElements.includes(nextElement);
609
- focusableElements = focusableElements.filter(el => nextElement.contains(el) && el);
610
- if (isNextElementInFocusables || focusableElements.length <= 1) {
608
+ const focusableAroundNextElement = findFocusable(nextElement.parentElement, {
609
+ includeSelectors: [`[${DATA_ATTRIBUTES.FOCUSABLE}]`],
610
+ excludeSelectors: [`[${DATA_ATTRIBUTES.EXCLUDE}]`],
611
+ });
612
+ const isNextElementInFocusables = focusableAroundNextElement.includes(nextElement);
613
+ focusableElements = focusableAroundNextElement.filter(el => nextElement.contains(el) && el !== nextElement);
614
+ if (isNextElementInFocusables || focusableElements.length <= 0) {
611
615
  // Use nextElement if it focusable
612
616
  return nextElement;
613
617
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.134.17",
4
+ "version": "0.134.18",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"