Open yasaricli opened 4 years ago
Hi,
Any updates on this ?
Thanks!!
@Foskas , after working around, here is my solution how can call these functions scrollToEnd, scrollIntoView,.. for functional component
let scrollProps;
<KeyboardAwareScrollView
innerRef={(ref) => {
scrollProps = ref._internalFiberInstanceHandleDEV.memoizedProps;
}}
/>
const _scrollToInput = (reactNode: ReactNode) => {
// 200 is extra height after scrolling to component
scrollProps.scrollToFocusedInput(reactNode, 200);
};
<TextInput onFocus={(event) => _scrollToInput(findNodeHandle(event.target))} />
@nhatndm I was able to achieve this in more accurate way:
<KeyboardAwareScrollView
innerRef={(ref) => { this.scrollView = ref.getScrollResponder(); }}
/>
const _scrollToInput = (reactNode: ReactNode) => {
this.scrollView.props.scrollToFocusedInput(inputNode, 200);
};
@olegmilan I modified this to allow for instance removal:
<KeyboardAwareScrollView
innerRef={(ref) => { this.scrollView = ref ? ref.getScrollResponder() : null; }}
/>
When I run scrollToEnd in version 0.63, I get the error
scrollIntoView
of undefined.also now scroll.props.scrollToEnd gives an error. Because there are no props.
Warning:
this is a warning But it doesn't scroll down.
Thanks.