2022-11-24 17:48:37 +00:00
|
|
|
diff --git a/node_modules/react-native-ui-lib/lib/components/Keyboard/KeyboardInput/KeyboardAccessoryView.js b/node_modules/react-native-ui-lib/lib/components/Keyboard/KeyboardInput/KeyboardAccessoryView.js
|
|
|
|
index cfe1d35..7ce5105 100644
|
|
|
|
--- a/node_modules/react-native-ui-lib/lib/components/Keyboard/KeyboardInput/KeyboardAccessoryView.js
|
|
|
|
+++ b/node_modules/react-native-ui-lib/lib/components/Keyboard/KeyboardInput/KeyboardAccessoryView.js
|
|
|
|
@@ -123,7 +123,13 @@ class KeyboardAccessoryView extends Component {
|
|
|
|
* Whether or not to handle SafeArea
|
|
|
|
* default: true
|
|
|
|
*/
|
|
|
|
- useSafeArea: PropTypes.bool
|
|
|
|
+ useSafeArea: PropTypes.bool,
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * iOS only.
|
|
|
|
+ * Scroll view to track
|
|
|
|
+ */
|
|
|
|
+ scrollViewNativeID: PropTypes.string
|
|
|
|
};
|
|
|
|
|
|
|
|
static iosScrollBehaviors = IOS_SCROLL_BEHAVIORS;
|
|
|
|
@@ -256,7 +262,8 @@ class KeyboardAccessoryView extends Component {
|
|
|
|
kbComponent,
|
|
|
|
onItemSelected,
|
|
|
|
onRequestShowKeyboard,
|
|
|
|
- useSafeArea
|
|
|
|
+ useSafeArea,
|
|
|
|
+ scrollViewNativeID
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
@@ -271,6 +278,7 @@ class KeyboardAccessoryView extends Component {
|
|
|
|
addBottomView={addBottomView}
|
|
|
|
bottomViewColor={this.props.bottomViewColor}
|
|
|
|
allowHitsOutsideBounds={allowHitsOutsideBounds}
|
|
|
|
+ scrollViewNativeID={scrollViewNativeID}
|
|
|
|
>
|
|
|
|
{renderContent && renderContent()}
|
|
|
|
<CustomKeyboardView
|
2022-12-08 21:31:28 +00:00
|
|
|
diff --git a/node_modules/react-native-ui-lib/lib/ios/.DS_Store b/node_modules/react-native-ui-lib/lib/ios/.DS_Store
|
|
|
|
new file mode 100644
|
2022-12-09 20:20:24 +00:00
|
|
|
index 0000000..e69de29
|
2022-11-24 17:48:37 +00:00
|
|
|
diff --git a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.h b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.h
|
|
|
|
index b3864d0..e78322f 100644
|
|
|
|
--- a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.h
|
|
|
|
+++ b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.h
|
|
|
|
@@ -8,7 +8,7 @@
|
|
|
|
#if __has_include(<React/RCTEventEmitter.h>)
|
|
|
|
#import <React/RCTEventEmitter.h>
|
|
|
|
#else
|
|
|
|
-#import "RCTEventEmitter.h"
|
|
|
|
+#import <React/RCTEventEmitter.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
@interface RCTCustomInputControllerTemp : RCTEventEmitter
|
|
|
|
diff --git a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h
|
|
|
|
index 4344724..2786051 100644
|
|
|
|
--- a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h
|
|
|
|
+++ b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h
|
|
|
|
@@ -10,7 +10,7 @@
|
|
|
|
#if __has_include(<React/RCTRootView.h>)
|
|
|
|
#import <React/RCTRootView.h>
|
|
|
|
#else
|
|
|
|
-#import "RCTRootView.h"
|
|
|
|
+#import <React/RCTRootView.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
@interface RCTCustomKeyboardViewControllerTemp : UIInputViewController
|
|
|
|
diff --git a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m
|
2022-12-09 20:20:24 +00:00
|
|
|
index 8f8446e..fc9645c 100644
|
2022-11-24 17:48:37 +00:00
|
|
|
--- a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m
|
|
|
|
+++ b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m
|
|
|
|
@@ -54,6 +54,7 @@ @interface KeyboardTrackingViewTemp : UIView
|
|
|
|
@property (nonatomic) BOOL useSafeArea;
|
|
|
|
@property (nonatomic) BOOL scrollToFocusedInput;
|
|
|
|
@property (nonatomic) BOOL allowHitsOutsideBounds;
|
|
|
|
+@property (nonatomic) NSString* scrollViewNativeID;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@@ -84,6 +85,7 @@ -(instancetype)init
|
|
|
|
self.addBottomView = NO;
|
|
|
|
self.bottomViewColor = nil;
|
|
|
|
self.scrollToFocusedInput = NO;
|
|
|
|
+ self.scrollIsInverted = YES;
|
|
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(rctContentDidAppearNotification:) name:RCTContentDidAppearNotification object:nil];
|
|
|
|
}
|
|
|
|
@@ -170,7 +172,6 @@ -(void)layoutSubviews
|
|
|
|
- (void)initializeAccessoryViewsAndHandleInsets
|
|
|
|
{
|
|
|
|
NSArray<UIView*>* allSubviews = [self getBreadthFirstSubviewsForView:[self getRootView]];
|
|
|
|
- NSMutableArray<RCTScrollView*>* rctScrollViewsArray = [NSMutableArray array];
|
|
|
|
|
|
|
|
for (UIView* subview in allSubviews)
|
|
|
|
{
|
2022-12-08 21:31:28 +00:00
|
|
|
@@ -179,25 +180,14 @@ - (void)initializeAccessoryViewsAndHandleInsets
|
2022-11-24 17:48:37 +00:00
|
|
|
{
|
|
|
|
if(_scrollViewToManage == nil)
|
|
|
|
{
|
|
|
|
- if(_requiresSameParentToManageScrollView && [subview isKindOfClass:[RCTScrollView class]] && subview.superview == self.superview)
|
|
|
|
+ if([subview isKindOfClass:[RCTScrollView class]])
|
|
|
|
{
|
|
|
|
- _scrollViewToManage = ((RCTScrollView*)subview).scrollView;
|
2022-12-08 21:31:28 +00:00
|
|
|
- }
|
2022-11-24 17:48:37 +00:00
|
|
|
- else if(!_requiresSameParentToManageScrollView && [subview isKindOfClass:[UIScrollView class]])
|
|
|
|
- {
|
|
|
|
- _scrollViewToManage = (UIScrollView*)subview;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(_scrollViewToManage != nil)
|
|
|
|
- {
|
|
|
|
- _scrollIsInverted = CGAffineTransformEqualToTransform(_scrollViewToManage.superview.transform, CGAffineTransformMakeScale(1, -1));
|
2022-12-08 21:31:28 +00:00
|
|
|
+ RCTScrollView *scrollView = (RCTScrollView*)subview;
|
|
|
|
+ if (subview.nativeID && [subview.nativeID isEqualToString:self.scrollViewNativeID]) {
|
|
|
|
+ _scrollViewToManage = scrollView.scrollView;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
}
|
2022-11-24 17:48:37 +00:00
|
|
|
-
|
|
|
|
- if([subview isKindOfClass:[RCTScrollView class]])
|
|
|
|
- {
|
|
|
|
- [rctScrollViewsArray addObject:(RCTScrollView*)subview];
|
2022-12-08 21:31:28 +00:00
|
|
|
- }
|
2022-11-24 17:48:37 +00:00
|
|
|
}
|
|
|
|
|
2022-12-08 21:31:28 +00:00
|
|
|
if ([className isEqualToString:@"RCTTextField"])
|
2022-11-24 17:48:37 +00:00
|
|
|
@@ -246,15 +236,15 @@ - (void)initializeAccessoryViewsAndHandleInsets
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- for (RCTScrollView *scrollView in rctScrollViewsArray)
|
|
|
|
- {
|
|
|
|
- if(scrollView.scrollView == _scrollViewToManage)
|
|
|
|
- {
|
|
|
|
- [scrollView removeScrollListener:self];
|
|
|
|
- [scrollView addScrollListener:self];
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
+// for (RCTScrollView *scrollView in [_rctScrollViewsArray allValues])
|
|
|
|
+// {
|
|
|
|
+// if(scrollView.scrollView == _scrollViewToManage)
|
|
|
|
+// {
|
|
|
|
+// [scrollView removeScrollListener:self];
|
|
|
|
+// [scrollView addScrollListener:self];
|
|
|
|
+// break;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
|
|
#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_10_3
|
|
|
|
if (@available(iOS 11.0, *)) {
|
2022-12-09 20:20:24 +00:00
|
|
|
@@ -426,8 +416,8 @@ - (void)_updateScrollViewInsets
|
|
|
|
}
|
|
|
|
self.scrollViewToManage.contentInset = insets;
|
|
|
|
|
|
|
|
- if(self.scrollBehavior == KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly && _scrollIsInverted)
|
|
|
|
- {
|
|
|
|
+// if(self.scrollBehavior == KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly && _scrollIsInverted)
|
|
|
|
+// {
|
|
|
|
BOOL fisrtTime = _ObservingInputAccessoryViewTemp.keyboardHeight == 0 && _ObservingInputAccessoryViewTemp.keyboardState == KeyboardStateHidden;
|
|
|
|
BOOL willOpen = _ObservingInputAccessoryViewTemp.keyboardHeight != 0 && _ObservingInputAccessoryViewTemp.keyboardState == KeyboardStateHidden;
|
|
|
|
BOOL isOpen = _ObservingInputAccessoryViewTemp.keyboardHeight != 0 && _ObservingInputAccessoryViewTemp.keyboardState == KeyboardStateShown;
|
|
|
|
@@ -435,12 +425,12 @@ - (void)_updateScrollViewInsets
|
|
|
|
{
|
|
|
|
[self.scrollViewToManage setContentOffset:CGPointMake(self.scrollViewToManage.contentOffset.x, -self.scrollViewToManage.contentInset.top) animated:!fisrtTime];
|
|
|
|
}
|
|
|
|
- }
|
|
|
|
- else if(self.scrollBehavior == KeyboardTrackingScrollBehaviorFixedOffset && !self.isDraggingScrollView)
|
|
|
|
- {
|
|
|
|
- CGFloat insetsDiff = (bottomInset - originalBottomInset) * (self.scrollIsInverted ? -1 : 1);
|
|
|
|
- self.scrollViewToManage.contentOffset = CGPointMake(originalOffset.x, originalOffset.y + insetsDiff);
|
|
|
|
- }
|
|
|
|
+// }
|
|
|
|
+// if(!self.isDraggingScrollView)
|
|
|
|
+// {
|
|
|
|
+// CGFloat insetsDiff = (bottomInset - originalBottomInset) * (self.scrollIsInverted ? -1 : 1);
|
|
|
|
+// self.scrollViewToManage.contentOffset = CGPointMake(originalOffset.x, originalOffset.y + insetsDiff);
|
|
|
|
+// }
|
|
|
|
|
|
|
|
insets = self.scrollViewToManage.contentInset;
|
|
|
|
if(self.scrollIsInverted)
|
2022-11-24 17:48:37 +00:00
|
|
|
@@ -468,7 +458,6 @@ -(void)addBottomViewIfNecessary
|
|
|
|
if (self.addBottomView && _bottomView == nil)
|
|
|
|
{
|
|
|
|
_bottomView = [UIView new];
|
|
|
|
- // _bottomView.backgroundColor = [UIColor whiteColor];
|
|
|
|
if (self.bottomViewColor)
|
|
|
|
{
|
|
|
|
_bottomView.backgroundColor = [self colorFromHexString:self.bottomViewColor];
|
|
|
|
@@ -664,6 +653,7 @@ @implementation KeyboardTrackingViewTempManager
|
|
|
|
RCT_REMAP_VIEW_PROPERTY(useSafeArea, useSafeArea, BOOL)
|
|
|
|
RCT_REMAP_VIEW_PROPERTY(scrollToFocusedInput, scrollToFocusedInput, BOOL)
|
|
|
|
RCT_REMAP_VIEW_PROPERTY(allowHitsOutsideBounds, allowHitsOutsideBounds, BOOL)
|
|
|
|
+RCT_EXPORT_VIEW_PROPERTY(scrollViewNativeID, NSString)
|
|
|
|
|
|
|
|
+ (BOOL)requiresMainQueueSetup
|
|
|
|
{
|