@fluentui-react-native/focus-zone 0.10.7 → 0.10.10

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,52 @@
2
2
  "name": "@fluentui-react-native/focus-zone",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 05 Aug 2022 23:21:34 GMT",
5
+ "date": "Fri, 09 Sep 2022 21:52:53 GMT",
6
+ "tag": "@fluentui-react-native/focus-zone_v0.10.10",
7
+ "version": "0.10.10",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "sanajmi@microsoft.com",
12
+ "package": "@fluentui-react-native/focus-zone",
13
+ "commit": "09fde8faaa74ec81fe262fa43a82211197862854",
14
+ "comment": "(macOS) Fix bug when FocusZone wraps a ScrollView"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 06 Sep 2022 18:22:03 GMT",
21
+ "tag": "@fluentui-react-native/focus-zone_v0.10.9",
22
+ "version": "0.10.9",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "beachball",
27
+ "package": "@fluentui-react-native/focus-zone",
28
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.18.3",
29
+ "commit": "202705df4fb6402793b3368e586bfe16f0961070"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Mon, 29 Aug 2022 23:21:44 GMT",
36
+ "tag": "@fluentui-react-native/focus-zone_v0.10.8",
37
+ "version": "0.10.8",
38
+ "comments": {
39
+ "patch": [
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui-react-native/focus-zone",
43
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.18.2",
44
+ "commit": "370259af6f245b97a9a9129d8defbdd30a0bbd9d"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Fri, 05 Aug 2022 23:22:38 GMT",
6
51
  "tag": "@fluentui-react-native/focus-zone_v0.10.7",
7
52
  "version": "0.10.7",
8
53
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,36 @@
1
1
  # Change Log - @fluentui-react-native/focus-zone
2
2
 
3
- This log was last generated on Fri, 05 Aug 2022 23:21:34 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 09 Sep 2022 21:52:53 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.10.10
8
+
9
+ Fri, 09 Sep 2022 21:52:53 GMT
10
+
11
+ ### Patches
12
+
13
+ - (macOS) Fix bug when FocusZone wraps a ScrollView (sanajmi@microsoft.com)
14
+
15
+ ## 0.10.9
16
+
17
+ Tue, 06 Sep 2022 18:22:03 GMT
18
+
19
+ ### Patches
20
+
21
+ - Bump @fluentui-react-native/interactive-hooks to v0.18.3
22
+
23
+ ## 0.10.8
24
+
25
+ Mon, 29 Aug 2022 23:21:44 GMT
26
+
27
+ ### Patches
28
+
29
+ - Bump @fluentui-react-native/interactive-hooks to v0.18.2
30
+
7
31
  ## 0.10.7
8
32
 
9
- Fri, 05 Aug 2022 23:21:34 GMT
33
+ Fri, 05 Aug 2022 23:22:38 GMT
10
34
 
11
35
  ### Patches
12
36
 
@@ -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.7",
3
+ "version": "0.10.10",
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,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@fluentui-react-native/component-cache": "^1.4.0",
26
- "@fluentui-react-native/interactive-hooks": ">=0.18.1 <1.0.0",
26
+ "@fluentui-react-native/interactive-hooks": ">=0.18.3 <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
  },