Skip to content
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

RCTTextField is not a descendant of RCTShadowView #33

Closed
nazywamsiepawel opened this issue Jun 13, 2016 · 20 comments
Closed

RCTTextField is not a descendant of RCTShadowView #33

nazywamsiepawel opened this issue Jun 13, 2016 · 20 comments

Comments

@nazywamsiepawel
Copy link

Hey!

Thanks for react-native-keyboard-aware-scroll-view! All works great apart from the issue in which all of the TextFields which are not contained within stop working. The error appears after the keyboard is presented :

img_4983

@alvaromb
Copy link
Collaborator

Hello @nazywamsiepawel!

Yes, this is a known issue #25

I've opened a PR in react-native to solve this: facebook/react-native#7876

In the meantime, if you take the code of the PR and the code of the ancestor_check branch you can solve the issue.

I hope this gets merged and solved soon.

Thanks!

@nazywamsiepawel
Copy link
Author

Gracias!

@alvaromb
Copy link
Collaborator

Glad to have helped @nazywamsiepawel 😉

Let's close this and track the issue in #25

@JosephkimOS
Copy link

@nazywamsiepawel did you solve this problem? I followed all steps which suggested by @alvaromb

I face the warning message blow

'keyboardWillShow' event should be registered via the Keyboard module.
'keyboardWillHide' event should be registered via the Keyboard module.

And get the following error message get TextInput get focused.

"_reactNative.UIManager.viewIsAncestorOf is not a found"

Please share your experience. thank you.

@alvaromb
Copy link
Collaborator

The warning messages are not related to the ancestor/descendant check. With v0.1.2 there shouldn't be any warnings.

For the viewIsAncestorOf, please refer to the PR and apply that to your source code: facebook/react-native#7876

@JosephDev
Copy link

I patched it and cherry picked commit "A version with the RN ancestor stuff" and "Check if there is a focused field before trying to scroll to it"

However, still face TypeError: _reactNative.UIManager.viewIsAncestorOf is not a function error

here is my code where it throw an exception

if (this.props.enableAutoAutomaticScroll) {
      const currentlyFocusedField = TextInput.State.currentlyFocusedField()
      if (!currentlyFocusedField) {
        return
      }
      try {
        console.log(UIManager)
        UIManager.viewIsAncestorOf(
          currentlyFocusedField,
          this.getScrollHandle().getScrollResponder().getInnerViewNode(),
          (isAncestor) => {
            if (isAncestor) {
              this.scrollToFocusedInputWithNodeHandle(currentlyFocusedField)
            }
          }
        )
      } catch (e) {
        console.log(e)
      }
    }

@JosephDev
Copy link

I create a PR with this issue. PR #41
UIManager.viewIsAncestorOf => UIManager.viewIsDescendantOf

@ghost
Copy link

ghost commented Jul 28, 2016

I'm getting the same error message as referenced by nazywamsiepawel above. Are you close to a solution? Is there a current workaround? I'm a bit frantic.

@JosephDev
Copy link

@idavidson12 it's a solved problem. Even some involved manual work, you can use this project with sub pages. Please check previous comments, written by @alvaromb and @JosephDev

@ghost
Copy link

ghost commented Jul 28, 2016

I don't think I'm up to this level of coding yet. Will there be an update to the module itself soon?

@JosephDev
Copy link

JosephDev commented Jul 28, 2016

@idavidson12 um... you can clone my repo. instead using npm to install git clone https://github.com/JosephDev/react-native-keyboard-aware-scroll-view.git#ancestor_check

However, you have to modify iOS project files by yourself unless RN project merge @alvaromb 's PR facebook/react-native#7876.

@ghost
Copy link

ghost commented Jul 28, 2016

Great. Thank you.

@ghost
Copy link

ghost commented Aug 4, 2016

After implementing @alvaromb's changes I get a error that
'CSSLayout/CSSLayout.h' not found.' Do you have any idea how I might
resolve that?

Thanks for your module.

Iver

On Thu, Jul 28, 2016 at 3:48 PM, JOSEPH KIM [email protected]
wrote:

@idavidson12 https://github.com/idavidson12 um... you can clone my code
instead using npm to install git clone https://github.com/JosephDev/
react-native-keyboard-aware-scroll-view.git#ancestor_check

However, you have to modify iOS project files by yourself unless RN
project merge @alvaromb https://github.com/alvaromb 's PR
facebook/react-native#7876
facebook/react-native#7876.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#33 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANg7Qv96QpoHQ1FL1MmvYMD0H3N0sr9Sks5qaSO3gaJpZM4I0TnG
.

@alvaromb
Copy link
Collaborator

alvaromb commented Aug 5, 2016

Please use the official branch for the ancestor check @idavidson12 https://github.com/APSL/react-native-keyboard-aware-scroll-view/tree/ancestor_check

My PR was accepted a few days ago and it should land into RN 0.32.0 facebook/react-native#7876

Regarding the CSSLayout error you're getting, is it possible that you have removed some code accidentally? I'm using the component in all of my projects and I don't get that error.

@imchathu87
Copy link

did every thing you mentioned and not working :( :(

@cbcye
Copy link

cbcye commented Aug 18, 2016

Resolve this problem.

  1. npm install https://github.com/APSL/react-native-keyboard-aware-scroll-view.git#ancestor_check
  2. modify the RN core file follow: facebook/react-native@e52cab5

I don't know how to modify after read facebook/react-native#7876, so direct read the source code that @alvaromb submit to RN official. then resolved it, spend near 5 hours :-< , Anyway, thank you @alvaromb 's hard work and contribute.

@onepiece-dz
Copy link

@alvaromb how android resolve it?

@cbcye
Copy link

cbcye commented Oct 2, 2016

after upgrade to RN0.34 still have this problem
wechatimg3

@Bundas
Copy link

Bundas commented Aug 27, 2017

Hey, i am using latest react native and still facing this error...

"react-native-keyboard-aware-scroll-view": "^0.3.0",

@alvaromb
Copy link
Collaborator

Try to remove the node_modules/ folder and re-install dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants