@fluentui-react-native/focus-zone 0.8.16 → 0.9.1

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,67 @@
2
2
  "name": "@fluentui-react-native/focus-zone",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 26 Jan 2022 17:00:53 GMT",
5
+ "date": "Wed, 09 Feb 2022 20:13:22 GMT",
6
+ "tag": "@fluentui-react-native/focus-zone_v0.9.1",
7
+ "version": "0.9.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui-react-native/focus-zone",
13
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.13.0",
14
+ "commit": "f7264338409e4a7e4cbb4f4fb815d4ab32276d8a"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Fri, 04 Feb 2022 20:31:52 GMT",
21
+ "tag": "@fluentui-react-native/focus-zone_v0.9.0",
22
+ "version": "0.9.0",
23
+ "comments": {
24
+ "minor": [
25
+ {
26
+ "author": "sanajmi@microsoft.com",
27
+ "package": "@fluentui-react-native/focus-zone",
28
+ "commit": "362642ae324275de74803fcf63f882636088c08f",
29
+ "comment": "Several fixes to macOS FocusZone"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Wed, 02 Feb 2022 02:29:07 GMT",
36
+ "tag": "@fluentui-react-native/focus-zone_v0.8.18",
37
+ "version": "0.8.18",
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.12.2",
44
+ "commit": "c42dec6d24b24ded9a85dd11076e49d9b92980aa"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Wed, 26 Jan 2022 20:31:04 GMT",
51
+ "tag": "@fluentui-react-native/focus-zone_v0.8.17",
52
+ "version": "0.8.17",
53
+ "comments": {
54
+ "patch": [
55
+ {
56
+ "author": "beachball",
57
+ "package": "@fluentui-react-native/focus-zone",
58
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.12.1",
59
+ "commit": "1f6a66699e8a06bfd55a613ee9019ba8ca27d0b4"
60
+ }
61
+ ]
62
+ }
63
+ },
64
+ {
65
+ "date": "Wed, 26 Jan 2022 17:02:27 GMT",
6
66
  "tag": "@fluentui-react-native/focus-zone_v0.8.16",
7
67
  "version": "0.8.16",
8
68
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,44 @@
1
1
  # Change Log - @fluentui-react-native/focus-zone
2
2
 
3
- This log was last generated on Wed, 26 Jan 2022 17:00:53 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 09 Feb 2022 20:13:22 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.9.1
8
+
9
+ Wed, 09 Feb 2022 20:13:22 GMT
10
+
11
+ ### Patches
12
+
13
+ - Bump @fluentui-react-native/interactive-hooks to v0.13.0
14
+
15
+ ## 0.9.0
16
+
17
+ Fri, 04 Feb 2022 20:31:52 GMT
18
+
19
+ ### Minor changes
20
+
21
+ - Several fixes to macOS FocusZone (sanajmi@microsoft.com)
22
+
23
+ ## 0.8.18
24
+
25
+ Wed, 02 Feb 2022 02:29:07 GMT
26
+
27
+ ### Patches
28
+
29
+ - Bump @fluentui-react-native/interactive-hooks to v0.12.2
30
+
31
+ ## 0.8.17
32
+
33
+ Wed, 26 Jan 2022 20:31:04 GMT
34
+
35
+ ### Patches
36
+
37
+ - Bump @fluentui-react-native/interactive-hooks to v0.12.1
38
+
7
39
  ## 0.8.16
8
40
 
9
- Wed, 26 Jan 2022 17:00:53 GMT
41
+ Wed, 26 Jan 2022 17:02:27 GMT
10
42
 
11
43
  ### Patches
12
44
 
@@ -15,6 +15,6 @@ typedef NS_ENUM(NSInteger, FocusZoneDirection) {
15
15
  @property(nonatomic) BOOL disabled;
16
16
  @property(nonatomic) FocusZoneDirection focusZoneDirection;
17
17
  @property(nonatomic) NSString *navigateAtEnd;
18
- @property(nonatomic) NSView *defaultTabbableElement;
18
+ @property(nonatomic) NSView *defaultKeyView;
19
19
 
20
20
  @end
@@ -45,6 +45,21 @@ static inline CGFloat GetMinDistanceBetweenRectVerticesAndPoint(NSRect rect, NSP
45
45
  );
46
46
  }
47
47
 
48
+ static NSView *GetFirstKeyViewWithin(NSView *parentView)
49
+ {
50
+ for (NSView *view in [parentView subviews]) {
51
+ if ([view canBecomeKeyView]) {
52
+ return view;
53
+ }
54
+
55
+ NSView *match = GetFirstKeyViewWithin(view);
56
+ if (match) {
57
+ return match;
58
+ }
59
+ }
60
+ return nil;
61
+ }
62
+
48
63
  static NSView *GetFirstResponder(NSWindow *window)
49
64
  {
50
65
  NSResponder *responder = [window firstResponder];
@@ -124,13 +139,14 @@ static RCTFocusZone *GetFocusZoneAncestor(NSView *view)
124
139
 
125
140
  - (BOOL)acceptsFirstResponder
126
141
  {
127
- // Accept firstResponder on FocusZone itself in order to reassign it to defaultTabbableElement.
142
+ // Accept firstResponder on FocusZone itself in order to reassign it within the FocusZone.
128
143
  return !_disabled;
129
144
  }
130
145
 
131
146
  - (BOOL)becomeFirstResponder
132
147
  {
133
- return !_disabled && [[self window] makeFirstResponder:_defaultTabbableElement ?: [self nextValidKeyView]];
148
+ NSView *keyView = _defaultKeyView ?: GetFirstKeyViewWithin(self);
149
+ return !_disabled && [[self window] makeFirstResponder:keyView];
134
150
  }
135
151
 
136
152
  - (NSView *)nextViewToFocusForCondition:(IsViewLeadingCandidateForNextFocus)isLeadingCandidate
@@ -314,7 +330,7 @@ static RCTFocusZone *GetFocusZoneAncestor(NSView *view)
314
330
  // If the previous view is in a FocusZone, focus the default tabbable element.
315
331
  // (For FocusZoneActionTab, this is handled by becomeFirstResponder.)
316
332
  RCTFocusZone *nextFocusZone = GetFocusZoneAncestor(nextViewToFocus);
317
- NSView *element = [nextFocusZone defaultTabbableElement];
333
+ NSView *element = [nextFocusZone defaultKeyView];
318
334
  if (element != nil)
319
335
  {
320
336
  nextViewToFocus = element;
@@ -351,7 +367,7 @@ static RCTFocusZone *GetFocusZoneAncestor(NSView *view)
351
367
  && (action == FocusZoneActionUpArrow || action == FocusZoneActionDownArrow))
352
368
  || (focusZoneDirection == FocusZoneDirectionNone))
353
369
  {
354
- // do nothing
370
+ [super keyDown:event];
355
371
  }
356
372
  else
357
373
  {
@@ -368,7 +384,7 @@ static RCTFocusZone *GetFocusZoneAncestor(NSView *view)
368
384
  }
369
385
  else
370
386
  {
371
- NSBeep();
387
+ [super keyDown:event];
372
388
  }
373
389
  }
374
390
 
@@ -382,4 +398,4 @@ static RCTFocusZone *GetFocusZoneAncestor(NSView *view)
382
398
  return @"NavigateStopAtEnds";
383
399
  }
384
400
 
385
- @end
401
+ @end
@@ -40,7 +40,7 @@ RCT_CUSTOM_VIEW_PROPERTY(defaultTabbableElement, NSNumber, RCTFocusZone)
40
40
  NSNumber *tag = [RCTConvert NSNumber:json];
41
41
  RCTUIManager *manager = [[self bridge] uiManager];
42
42
  NSView *element = [manager viewForReactTag:tag];
43
- [view setDefaultTabbableElement:element];
43
+ [view setDefaultKeyView:element];
44
44
  }
45
45
 
46
46
  - (RCTView *)view
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/focus-zone",
3
- "version": "0.8.16",
3
+ "version": "0.9.1",
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.3.1",
26
- "@fluentui-react-native/interactive-hooks": ">=0.12.0 <1.0.0",
26
+ "@fluentui-react-native/interactive-hooks": ">=0.13.0 <1.0.0",
27
27
  "@uifabricshared/foundation-composable": ">=0.10.2 <1.0.0",
28
28
  "@uifabricshared/foundation-settings": ">=0.11.2 <1.0.0"
29
29
  },