@fluentui-react-native/callout 0.24.8 → 0.24.9

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,22 @@
2
2
  "name": "@fluentui-react-native/callout",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 14 Jul 2023 23:31:28 GMT",
5
+ "date": "Sat, 15 Jul 2023 23:00:36 GMT",
6
+ "tag": "@fluentui-react-native/callout_v0.24.9",
7
+ "version": "0.24.9",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "nakambo@microsoft.com",
12
+ "package": "@fluentui-react-native/callout",
13
+ "commit": "d00b3a1d07d0dc05083e02fd1dcc7e8a264290c9",
14
+ "comment": "[macOS] [FRNCallout] Fix switching betwen `target` and `anchorRect`"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Fri, 14 Jul 2023 23:32:22 GMT",
6
21
  "tag": "@fluentui-react-native/callout_v0.24.8",
7
22
  "version": "0.24.8",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Change Log - @fluentui-react-native/callout
2
2
 
3
- This log was last generated on Fri, 14 Jul 2023 23:31:28 GMT and should not be manually modified.
3
+ This log was last generated on Sat, 15 Jul 2023 23:00:36 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.24.9
8
+
9
+ Sat, 15 Jul 2023 23:00:36 GMT
10
+
11
+ ### Patches
12
+
13
+ - [macOS] [FRNCallout] Fix switching betwen `target` and `anchorRect` (nakambo@microsoft.com)
14
+
7
15
  ## 0.24.8
8
16
 
9
- Fri, 14 Jul 2023 23:31:28 GMT
17
+ Fri, 14 Jul 2023 23:32:22 GMT
10
18
 
11
19
  ### Patches
12
20
 
@@ -6,8 +6,9 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
6
6
 
7
7
  @objc public var target: NSNumber? {
8
8
  didSet {
9
- guard let targetView = bridge?.uiManager.view(forReactTag: target) else {
10
- preconditionFailure("Invalid target react tag")
9
+ let targetView = bridge?.uiManager.view(forReactTag: target)
10
+ if (targetView == nil && target != nil) {
11
+ preconditionFailure("Invalid target")
11
12
  }
12
13
  anchorView = targetView
13
14
  updateCalloutFrameToAnchor()
@@ -169,10 +170,16 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
169
170
  return
170
171
  }
171
172
 
172
- // Prefer anchorRect over anchorView if available
173
- let anchorScreenRect = anchorRect.equalTo(.null) ? calculateAnchorViewScreenRect() : calculateAnchorRectScreenRect()
173
+ // Prefer anchorView over anchorRect if available
174
+ let anchorScreenRect = anchorView != nil ? calculateAnchorViewScreenRect() : calculateAnchorRectScreenRect()
174
175
  let calloutScreenRect = bestCalloutRect(relativeTo: anchorScreenRect)
175
176
 
177
+ // Because we immediately update the rect as props come in, there's a possibility that we have neither
178
+ // of anchorRect and target. Don't update until we have at least one.
179
+ guard !calloutScreenRect.isEmpty else {
180
+ return
181
+ }
182
+
176
183
  proxyView.frame.origin = .zero
177
184
  calloutWindow.setFrame(calloutScreenRect, display: false)
178
185
  }
@@ -347,7 +354,7 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
347
354
 
348
355
  // MARK: Private variables
349
356
 
350
- /// The view the Callout is presented from, if anchorRect is nil.
357
+ /// The view the Callout is presented from.
351
358
  private var anchorView: NSView?
352
359
 
353
360
  /// The view we forward Callout's Children to. It's hosted within the CalloutWindow's
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/callout",
3
- "version": "0.24.8",
3
+ "version": "0.24.9",
4
4
  "description": "A cross-platform Callout component using the Fluent Design System",
5
5
  "license": "MIT",
6
6
  "author": "",