@enact/spotlight 5.3.2 → 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 +6 -0
- package/package.json +4 -4
- package/src/target.js +16 -6
- package/src/tests/target-specs.js +1901 -217
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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
|
+
|
|
5
11
|
## [5.3.2] - 2025-10-28
|
|
6
12
|
|
|
7
13
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/spotlight",
|
|
3
|
-
"version": "5.
|
|
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.
|
|
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.
|
|
33
|
-
"react-dom": "^19.
|
|
32
|
+
"react": "^19.2.0",
|
|
33
|
+
"react-dom": "^19.2.0",
|
|
34
34
|
"warning": "^4.0.3"
|
|
35
35
|
}
|
|
36
36
|
}
|
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
|
-
//
|
|
200
|
-
if (
|
|
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
|
};
|
|
@@ -302,10 +303,19 @@ function getTargetInContainerByDirectionFromElement(direction, containerId, elem
|
|
|
302
303
|
var nextCandidateContainerId = (0, _container.getContainersForNode)(next).pop();
|
|
303
304
|
// check if we want to navigate to another container
|
|
304
305
|
if (next && containerId !== nextCandidateContainerId) {
|
|
305
|
-
//
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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
|
+
return {
|
|
310
|
+
v: next
|
|
311
|
+
};
|
|
312
|
+
} else {
|
|
313
|
+
// otherwise, try to navigate to an element that is visible in its container
|
|
314
|
+
next = (0, _navigate["default"])(elementRect, direction, elementRects.filter(function (rect) {
|
|
315
|
+
var elementContainerId = (0, _container.getContainersForNode)(rect.element).pop();
|
|
316
|
+
return isElementVisibleInContainer(rect.element, elementContainerId);
|
|
317
|
+
}), (0, _container.getContainerConfig)(containerId), partitionRect);
|
|
318
|
+
}
|
|
309
319
|
}
|
|
310
320
|
|
|
311
321
|
// If we've met every condition and haven't explicitly retried the search via `continue`,
|