-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added property to indicate that the view is inside a Tabbar #6
base: master
Are you sure you want to change the base?
Conversation
Hey @AidenMontgomery, thanks a lot for the PR! You're right, we're aware of this issue and for now we went with the assumption that it is used in a screen without a tab-bar. If we're going to make this change I think we should do it a bit different. Instead of using a props and a hard-coded value we can use the Can you make this change? If so, please keep in mind that we need to make sure that it doesn't break anything in current features like the various scroll behaviors (regardless if we're using hard-coded values or not). Thoughts? |
Hi @artald |
@AidenMontgomery thanks, let me know if you have any questions |
@artald I am struggling with this a little. I am attempting to use the following code to get the to current - (UIViewController *)reactViewController:(UIView *)view
{
id responder = [view nextResponder];
while (responder) {
if ([responder isKindOfClass:[UIViewController class]]) {
return responder;
}
responder = [responder nextResponder];
}
return nil;
} This appears to work, in that it responds with a I altered the code a little to print out the type of the
As you can see, the What would be acceptable for this project? |
Thanks for all the efforts @AidenMontgomery ! Actually there is a method called It would be acceptable of course if there's no other way, but I'd like to investigate it a bit further before we push this kind of change. I hope it's not holding you back, I'll need a few days before I can investigate it. |
I came across the reactViewController method in some of my research and saw that it did almost the same thing as what I had implemented. |
Yes, it does almost the same thing except what you added for checking the bottomLayoutGuide A fork is an excellent temporary solution, I hope we can get this in soon. Also, an example screen with tabs is a great idea. thanks! |
I have created a sample application, which somewhat replicates what I am trying to achieve in my project. It is very rough, but demonstrates the issue I was facing. React Native Keyboard Tracking View Example I don't know if I have done something wrong in my implementation, but it seemed like the react-native-keyboard-tracking-view only applied to the second tab it was registered in. |
@AidenMontgomery thanks for setting up a demo project! I didn't understand something - is this issue related to the PR and was caused as a result of the changes to support the tab-bar, or is it a totally separate issue that was occurring anyway? |
Apologies for causing confusion, the example application is using the currently published of this module from npm. I was hoping to put together a sample that showed the difference between the behaviour in a tab-bar and without the tab-bar. I have set up 2 tabs in the application, the first keeps the tabs on screen and was intended to replicate the issue that I originally saw. The second tab hides the tabs and I was hoping that this would then not display the original issue. However, upon creating the example I have found the issue with the keyboard tracking only applying to the last instance. |
Got it. thanks. I don't have an idea why it only works for the latest instance, we use it multiple times without any issues, but maybe this specific structure of the example is causing this. It's really weird since each view controller has its own root view and they are not related. Maybe it's best right now to solve one issue at a time. For now the demo app can have just one screen with tabs so we can focus on the |
I have set the master branch of the example to reflect the original issue that I created the PR for. I only use this control in one of the tabs in my app, so this second issue is not something that I have seen before and it is not causing me any immediate issues. |
Great, thanks. hopefully I'll have time to look into it sometime this week or next week. |
8826001
to
87d89c9
Compare
Hi @artald @AidenMontgomery and I have returned to work for our client where we first experienced the issue of the gap between the keyboard tracking view and the keyboard when inside a tab-bar. Whilst we've been away the reference to Aiden's fork was removed when our client performed a package update. I've just spent some time updating PR #6 to the very latest version of the react-native-keyboard-tracking-view and have amended the PR to a single commit so it's hopefully very clear the changes that have been made. We'd be very grateful if you could take the time to look at PR #6 as, whilst we've once again set our client's project to reference Aiden's fork, there's no guarantee that our client won't revert that change in the future. Many thanks, Gareth. |
6ba0d83
to
faf4294
Compare
I found that the tracking view was floating quite far away from the keyboard when my view was inside a tabbed view controller.
I added a property
viewIsInsideTabBar
to the view to indicate that the tracking view is inside a tabbar.