@fluentui-react-native/focus-zone 0.10.9 → 0.10.11

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.json CHANGED
@@ -2,7 +2,45 @@
2
2
  "name": "@fluentui-react-native/focus-zone",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 06 Sep 2022 18:20:47 GMT",
5
+ "date": "Wed, 14 Sep 2022 23:05:57 GMT",
6
+ "tag": "@fluentui-react-native/focus-zone_v0.10.11",
7
+ "version": "0.10.11",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "ruaraki@microsoft.com",
12
+ "package": "@fluentui-react-native/focus-zone",
13
+ "commit": "bb45f425d71a2c9f4c8088ae2e15d93759b915bb",
14
+ "comment": "No changes"
15
+ }
16
+ ],
17
+ "patch": [
18
+ {
19
+ "author": "beachball",
20
+ "package": "@fluentui-react-native/focus-zone",
21
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.18.4",
22
+ "commit": "bb45f425d71a2c9f4c8088ae2e15d93759b915bb"
23
+ }
24
+ ]
25
+ }
26
+ },
27
+ {
28
+ "date": "Fri, 09 Sep 2022 21:53:29 GMT",
29
+ "tag": "@fluentui-react-native/focus-zone_v0.10.10",
30
+ "version": "0.10.10",
31
+ "comments": {
32
+ "patch": [
33
+ {
34
+ "author": "sanajmi@microsoft.com",
35
+ "package": "@fluentui-react-native/focus-zone",
36
+ "commit": "09fde8faaa74ec81fe262fa43a82211197862854",
37
+ "comment": "(macOS) Fix bug when FocusZone wraps a ScrollView"
38
+ }
39
+ ]
40
+ }
41
+ },
42
+ {
43
+ "date": "Tue, 06 Sep 2022 18:22:03 GMT",
6
44
  "tag": "@fluentui-react-native/focus-zone_v0.10.9",
7
45
  "version": "0.10.9",
8
46
  "comments": {
@@ -11,7 +49,7 @@
11
49
  "author": "beachball",
12
50
  "package": "@fluentui-react-native/focus-zone",
13
51
  "comment": "Bump @fluentui-react-native/interactive-hooks to v0.18.3",
14
- "commit": "e52f325b57b4c2284d48ee69c250e150a324d313"
52
+ "commit": "202705df4fb6402793b3368e586bfe16f0961070"
15
53
  }
16
54
  ]
17
55
  }
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @fluentui-react-native/focus-zone
2
2
 
3
- This log was last generated on Tue, 06 Sep 2022 18:20:47 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 14 Sep 2022 23:05:57 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.10.11
8
+
9
+ Wed, 14 Sep 2022 23:05:57 GMT
10
+
11
+ ### Patches
12
+
13
+ - Bump @fluentui-react-native/interactive-hooks to v0.18.4
14
+
15
+ ## 0.10.10
16
+
17
+ Fri, 09 Sep 2022 21:53:29 GMT
18
+
19
+ ### Patches
20
+
21
+ - (macOS) Fix bug when FocusZone wraps a ScrollView (sanajmi@microsoft.com)
22
+
7
23
  ## 0.10.9
8
24
 
9
- Tue, 06 Sep 2022 18:20:47 GMT
25
+ Tue, 06 Sep 2022 18:22:03 GMT
10
26
 
11
27
  ### Patches
12
28
 
@@ -222,8 +222,10 @@ static BOOL ShouldSkipFocusZone(NSView *view)
222
222
 
223
223
  NSView *firstResponder = GetFirstResponder([self window]);
224
224
  NSRect firstResponderRect = [firstResponder convertRect:[firstResponder bounds] toView:self];
225
+ NSScrollView * firstResponderEnclosingScrollView = [firstResponder enclosingScrollView];
225
226
 
226
227
  __block CGFloat closestDistance = CGFLOAT_MAX;
228
+ __block CGFloat closestDistanceWithinEnclosingScrollView = CGFLOAT_MAX;
227
229
 
228
230
  IsViewLeadingCandidateForNextFocus block = ^BOOL(NSView *candidateView)
229
231
  {
@@ -274,10 +276,24 @@ static BOOL ShouldSkipFocusZone(NSView *view)
274
276
  if (!skip)
275
277
  {
276
278
  CGFloat distance = GetDistanceBetweenCentersOfRects(firstResponderRect, candidateRect);
277
- if (closestDistance > distance)
279
+
280
+ // If there are other candidate views inside the same ScrollView as the firstResponder,
281
+ // prefer those views over other views outside the scrollview, even if they are closer.
282
+ if ([firstResponderEnclosingScrollView isEqualTo:[candidateView enclosingScrollView]])
278
283
  {
279
- closestDistance = distance;
280
- isLeadingCandidate = YES;
284
+ if (closestDistanceWithinEnclosingScrollView > distance)
285
+ {
286
+ closestDistanceWithinEnclosingScrollView = distance;
287
+ isLeadingCandidate = YES;
288
+ }
289
+ }
290
+ else
291
+ {
292
+ if (closestDistance > distance)
293
+ {
294
+ closestDistance = distance;
295
+ isLeadingCandidate = YES;
296
+ }
281
297
  }
282
298
  }
283
299
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/focus-zone",
3
- "version": "0.10.9",
3
+ "version": "0.10.11",
4
4
  "description": "A cross-platform FocusZone component using the Fluent Design System",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -23,13 +23,13 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@fluentui-react-native/component-cache": "^1.4.0",
26
- "@fluentui-react-native/interactive-hooks": ">=0.18.3 <1.0.0",
26
+ "@fluentui-react-native/interactive-hooks": ">=0.18.4 <1.0.0",
27
27
  "@uifabricshared/foundation-composable": ">=0.11.0 <1.0.0",
28
28
  "@uifabricshared/foundation-settings": ">=0.12.0 <1.0.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@fluentui-react-native/eslint-config-rules": "^0.1.1",
32
- "@office-iss/react-native-win32": "^0.66.0",
32
+ "@office-iss/react-native-win32": "^0.66.6",
33
33
  "@types/react-native": "^0.66.0",
34
34
  "@fluentui-react-native/scripts": "^0.1.1",
35
35
  "react-native": "^0.66.0"