@enact/spotlight 5.3.1 → 5.4.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  The following is a curated list of changes in the Enact spotlight module, newest changes on the top.
4
4
 
5
+ ## [5.4.0] - 2025-12-08
6
+
7
+ ### Fixed
8
+
9
+ - `spotlight` to skip visibility check when entering a restricted container or choose a visible container as next target
10
+
11
+ ## [5.3.2] - 2025-10-28
12
+
13
+ ### Fixed
14
+
15
+ - `spotlight` navigation from an element to a different container on page load.
16
+
5
17
  ## [5.3.1] - 2025-10-14
6
18
 
7
19
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enact/spotlight",
3
- "version": "5.3.1",
3
+ "version": "5.4.0",
4
4
  "description": "A focus management library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,12 +25,12 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@enact/core": "^5.3.1",
28
+ "@enact/core": "^5.4.0",
29
29
  "classnames": "^2.5.1",
30
30
  "prop-types": "^15.8.1",
31
31
  "ramda": "^0.31.3",
32
- "react": "^19.1.0",
33
- "react-dom": "^19.1.0",
32
+ "react": "^19.2.0",
33
+ "react-dom": "^19.2.0",
34
34
  "warning": "^4.0.3"
35
35
  }
36
36
  }
package/src/container.js CHANGED
@@ -819,7 +819,7 @@ function getContainerFocusTarget(containerId, preferredEnterTo) {
819
819
  return result;
820
820
  } else if (isContainer(element)) {
821
821
  var nextId = isContainerNode(element) ? getContainerId(element) : element;
822
- return getContainerFocusTarget(nextId);
822
+ if (nextId !== containerId) return getContainerFocusTarget(nextId);
823
823
  }
824
824
  return element;
825
825
  }, null) || null;
package/src/target.js CHANGED
@@ -196,8 +196,9 @@ function getTargetInContainerByDirectionFromPosition(direction, containerId, pos
196
196
  var nextCandidateContainerId = (0, _container.getContainersForNode)(next).pop();
197
197
  // check if we want to navigate to another container
198
198
  if (next && containerId !== nextCandidateContainerId) {
199
- // verify is the element from another container is visible
200
- if (isElementVisibleInContainer(next, nextCandidateContainerId)) {
199
+ // Don't apply visibility check when entering a restricted container. The container's own enterTo logic (last-focused, default-element) handles entry
200
+ // OR verify if the element from another container is visible (only for non-restricted)
201
+ if (isRestrictedContainer(nextCandidateContainerId) || isElementVisibleInContainer(next, nextCandidateContainerId)) {
201
202
  return {
202
203
  v: next
203
204
  };
@@ -287,9 +288,7 @@ function getTargetInContainerByDirectionFromElement(direction, containerId, elem
287
288
 
288
289
  // and it is restricted, return its target
289
290
  if (isRestrictedContainer(nextContainerId)) {
290
- return {
291
- v: getTargetByContainer(nextContainerId)
292
- };
291
+ next = getTargetByContainer(nextContainerId);
293
292
  } else {
294
293
  // otherwise, recurse into it
295
294
  next = getTargetInContainerByDirectionFromElement(direction, nextContainerId, element, elementRect, elementContainerIds, getOverflowContainerRect(nextContainerId) || boundingRect);
@@ -304,8 +303,9 @@ function getTargetInContainerByDirectionFromElement(direction, containerId, elem
304
303
  var nextCandidateContainerId = (0, _container.getContainersForNode)(next).pop();
305
304
  // check if we want to navigate to another container
306
305
  if (next && containerId !== nextCandidateContainerId) {
307
- // verify is the element from another container is visible
308
- if (isElementVisibleInContainer(next, nextCandidateContainerId)) {
306
+ // Don't apply visibility check when entering a restricted container. The container's own enterTo logic (last-focused, default-element) handles entry
307
+ // OR verify if the element from another container is visible
308
+ if (isRestrictedContainer(nextCandidateContainerId) || isElementVisibleInContainer(next, nextCandidateContainerId)) {
309
309
  return {
310
310
  v: next
311
311
  };