-
Notifications
You must be signed in to change notification settings - Fork 74
input-scroll-view and wrapper #38
Comments
It seems that the parent element of the I don't see the problem from this picture? |
No, they're not. These inputs sits on bottom of page, which I should scroll to reach. When trying to focus on them, the Scrollview pushes them to top like this. |
It seems that
|
Hi baijunjie, my TextInput components are embedded and the code in _cloneDeepComponents does not recognize properly the multiline property and it does not set the multiline handler, because it is set internally of course:
This can be solved in the following way - a dedicated custom method is invoked in Component (when provided of course) so the wrapper is given the chance to return the TextInput component to your logic for further handliche. This method could. be called getTextInputComponent() in example. I will try to implement it and will give you feedback on success. UPDATE: I do not think I can access component's custom method from within children opaque data structure provided with this.props.children :( UPDATE: I've managed it to work, just had to proxying these three methods from parent to the embedded TextInput component:
and set ~cheers |
@bobozee If this method works and is tested, welcome to submit Pull requests. 👍 |
My first idea is not possible because React.Children provides so called opaque data structure for the child element and NOT the component itself so we are not able to access components methods at all. What I've done is to proxying the methods your solution needs to work in this way:
Notice the following lines:
I've replaced the not relevant parts with "..." so my TextInput components inside your InputScrollView have own states preventing the parent to redraw on every single key press. The use of my class later looks like:
and it's done. |
The question we are discussing seems to have nothing to do with this issue, you can reopen an issue. |
Hey,
I'm trying to render my input-scroll-view in this way:
But this doesn't work properly. It gives me this error:
It only works when I wrap the entire view with the input-scroll-view. But this doesn't let me to center align another view.
Thoughts?
Thanks
The text was updated successfully, but these errors were encountered: