Skip to content

Commit 61921b4

Browse files
authored
Fix/keyboard tracking view ios (#1849)
* fix keyboard translation with TabBar * check tabbar * remove log * bumping lib version
1 parent 3143056 commit 61921b4

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,28 @@ - (void) rctContentDidAppearNotification:(NSNotification*)notification
503503
});
504504
}
505505

506+
-(CGFloat)getTabBarHeight
507+
{
508+
if (@available(iOS 11.0, *)) {
509+
UIWindow *window = UIApplication.sharedApplication.windows.firstObject;
510+
if ([window.rootViewController isKindOfClass:[UITabBarController class]])
511+
{
512+
UITabBarController *tabBarController = [UITabBarController new];
513+
CGFloat tabBarHeight = tabBarController.tabBar.frame.size.height;
514+
CGFloat bottomPadding = window.safeAreaInsets.bottom;
515+
return tabBarHeight + bottomPadding;
516+
}
517+
}
518+
return 0;
519+
}
520+
506521
#pragma mark - ObservingInputAccessoryViewTempDelegate methods
507522

508523
-(void)updateTransformAndInsets
509524
{
510525
CGFloat bottomSafeArea = [self getBottomSafeArea];
511-
CGFloat accessoryTranslation = MIN(-bottomSafeArea, -_ObservingInputAccessoryViewTemp.keyboardHeight);
526+
CGFloat tabBarHeight = [self getTabBarHeight];
527+
CGFloat accessoryTranslation = MIN(-bottomSafeArea, -_ObservingInputAccessoryViewTemp.keyboardHeight + tabBarHeight);
512528

513529
if (_ObservingInputAccessoryViewTemp.keyboardHeight <= bottomSafeArea) {
514530
_bottomViewHeight = kBottomViewHeightTemp;

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uilib-native",
3-
"version": "3.0.4",
3+
"version": "3.0.5",
44
"homepage": "https://github.com/wix/react-native-ui-lib",
55
"description": "uilib native components (separated from js components)",
66
"main": "components/index.js",

0 commit comments

Comments
 (0)