react-native-sheet2 1.1.20 → 1.1.21
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/ios/SheetViewManager.swift +11 -2
- package/package.json +1 -1
- package/src/index.tsx +3 -6
|
@@ -15,7 +15,13 @@ class ModalHostShadowView: RCTShadowView {
|
|
|
15
15
|
override func insertReactSubview(_ subview: RCTShadowView!, at atIndex: Int) {
|
|
16
16
|
super.insertReactSubview(subview, at: atIndex)
|
|
17
17
|
if subview != nil {
|
|
18
|
-
|
|
18
|
+
let s = RCTScreenSize()
|
|
19
|
+
let orientation = UIDevice.current.orientation
|
|
20
|
+
var width = s.width
|
|
21
|
+
if orientation == .landscapeLeft || orientation == .landscapeRight {
|
|
22
|
+
width = s.height
|
|
23
|
+
}
|
|
24
|
+
(subview as RCTShadowView).width = YGValue.init(value: Float(width), unit: .point)
|
|
19
25
|
subview.position = .absolute
|
|
20
26
|
}
|
|
21
27
|
}
|
|
@@ -158,6 +164,7 @@ class HostFittedSheet: UIView {
|
|
|
158
164
|
@objc
|
|
159
165
|
var fittedSheetParams: NSDictionary? {
|
|
160
166
|
didSet {
|
|
167
|
+
debugPrint("😀 ", fittedSheetParams ?? "nil")
|
|
161
168
|
sheetMaxWidthSize = (fittedSheetParams?["maxWidth"] as? NSNumber)
|
|
162
169
|
sheetMaxHeightSize = (fittedSheetParams?["maxHeight"] as? NSNumber)
|
|
163
170
|
sheetMinHeightSize = (fittedSheetParams?["minHeight"] as? NSNumber)
|
|
@@ -227,8 +234,10 @@ class HostFittedSheet: UIView {
|
|
|
227
234
|
self._reactSubview?.layoutIfNeeded()
|
|
228
235
|
self._reactSubview?.sizeToFit()
|
|
229
236
|
size = self._reactSubview?.frame.size ?? .zero
|
|
237
|
+
debugPrint("😀 self._sheetSize?.floatValue == nil", size)
|
|
230
238
|
} else {
|
|
231
239
|
size = .init(width: self.sheetWidth, height: CGFloat(self._sheetSize!.floatValue))
|
|
240
|
+
debugPrint("😀 else", size)
|
|
232
241
|
}
|
|
233
242
|
if size.width > self.sheetWidth {
|
|
234
243
|
size.width = self.sheetWidth
|
|
@@ -335,7 +344,7 @@ class HostFittedSheet: UIView {
|
|
|
335
344
|
extension UIView {
|
|
336
345
|
func find(_ nId: String, deepIndex: Int) -> UIView? {
|
|
337
346
|
if deepIndex >= 10 { return nil }
|
|
338
|
-
if self.nativeID
|
|
347
|
+
if self.nativeID.contains(nId) || self.accessibilityIdentifier?.contains(nId) == true {
|
|
339
348
|
return self
|
|
340
349
|
}
|
|
341
350
|
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -5,11 +5,8 @@ import {
|
|
|
5
5
|
FittedSheetParams,
|
|
6
6
|
} from './FittedSheet';
|
|
7
7
|
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
useFittedSheetContext,
|
|
12
|
-
FittedSheetParams,
|
|
13
|
-
};
|
|
8
|
+
export { FittedSheet, FITTED_SHEET_SCROLL_VIEW, useFittedSheetContext };
|
|
9
|
+
|
|
10
|
+
export type { FittedSheetParams };
|
|
14
11
|
|
|
15
12
|
export { TopModal } from './TopModal';
|