@fluentui-react-native/focus-zone 0.23.5 → 0.23.6

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
@@ -1,5 +1,14 @@
1
1
  # Change Log - @fluentui-react-native/focus-zone
2
2
 
3
+ ## 0.23.6
4
+
5
+ ### Patch Changes
6
+
7
+ - bc0ba37: Fix Windows Fabric FocusZone Shift+Tab traversal when the zone is a first child so backward navigation cannot re-enter the zone or jump to a later sibling.
8
+ - Updated dependencies [3dbc30f]
9
+ - @fluentui-react-native/framework-base@0.8.1
10
+ - @fluentui-react-native/interactive-hooks@0.28.11
11
+
3
12
  ## 0.23.5
4
13
 
5
14
  ### Patch Changes
package/SPEC.md CHANGED
@@ -17,6 +17,10 @@ because it owns native macOS code and CocoaPods integration.
17
17
  forwarded without theme tokens or appearance defaults.
18
18
  - `isCircularNavigation` maps to the native `NavigateWrap` end behavior; otherwise
19
19
  navigation stops at the ends.
20
+ - With `tabKeyNavigation="None"`, Tab and Shift+Tab leave the zone. Backward
21
+ traversal considers preceding elements and focusable ancestors, not the zone's
22
+ descendants or later siblings, including when the zone is its parent's first
23
+ child.
20
24
 
21
25
  ## Platform behavior
22
26
 
@@ -27,7 +31,8 @@ because it owns native macOS code and CocoaPods integration.
27
31
  moves to item 5.
28
32
  - Windows includes a package-owned Fabric component view that coordinates
29
33
  directional, Home/End, Tab, and focus-restoration behavior through RNW
30
- `ComponentView` focus APIs.
34
+ `ComponentView` focus APIs. Backward zone exit walks reverse preorder and tests
35
+ each visited node itself rather than searching an ancestor's entire subtree.
31
36
  - Win32 continues to use its platform-provided native FocusZone implementation.
32
37
  Windows/Win32 use linear movement by default and opt into geometric movement
33
38
  with `use2DNavigation`.
@@ -45,3 +50,7 @@ types.
45
50
  Interactive directional, circular, Tab, disabled, and default-focus scenarios
46
51
  live with the agentic primitive stories in
47
52
  `packages/agentic/components/src/primitives/focus-zone/focus-zone.stories.tsx`.
53
+ The `FirstChildTabExit` native tests cover nested first-child containers with
54
+ later siblings and a preceding focusable subtree on all desktop endpoints.
55
+ They guard a Windows Fabric traversal defect; macOS uses its independent
56
+ AppKit key-view loop and shares the same outside-zone navigation requirement.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/focus-zone",
3
- "version": "0.23.5",
3
+ "version": "0.23.6",
4
4
  "description": "A cross-platform FocusZone component using the Fluent Design System",
5
5
  "license": "MIT",
6
6
  "author": "",
@@ -30,8 +30,8 @@
30
30
  "update-snapshots": "fluentui-scripts jest -u"
31
31
  },
32
32
  "dependencies": {
33
- "@fluentui-react-native/framework-base": "0.8.0",
34
- "@fluentui-react-native/interactive-hooks": "0.28.10"
33
+ "@fluentui-react-native/framework-base": "0.8.1",
34
+ "@fluentui-react-native/interactive-hooks": "0.28.11"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@babel/core": "^7.20.0",
@@ -452,8 +452,10 @@ struct FocusZoneComponentView
452
452
  }
453
453
  } else {
454
454
  for (auto node = PreOrderPrevious(container); node; node = PreOrderPrevious(node)) {
455
- auto candidate = winrtComp::FocusManager::FindLastFocusableElement(node);
456
- if (candidate && candidate.TryFocus(winrtRN::FocusState::Keyboard)) {
455
+ // Reverse preorder already visits descendants. Only focus the node itself,
456
+ // since searching an ancestor's subtree can re-enter the zone or move forward.
457
+ auto candidate = winrtComp::FocusManager::FindFirstFocusableElement(node);
458
+ if (candidate && candidate.Tag() == node.Tag() && candidate.TryFocus(winrtRN::FocusState::Keyboard)) {
457
459
  return true;
458
460
  }
459
461
  }