octopitus / rn-sliding-up-panel

Draggable sliding up panel implemented in React Native https://octopitus.github.io/rn-sliding-up-panel/
MIT License
930 stars 157 forks source link

Maximum call stack on keyboard did show #197

Open Dellybro opened 3 years ago

Dellybro commented 3 years ago

Issue Description

Ok after like months of blaming React Native for this issue, i have finally figured out what is really going on!!!! When sliding panel component is used at the bottom of a navigation stack, and then you navigate to another page which has input fields. Once you focus on a field you get an error "Maximum call stack exceeded"

Steps to Reproduce / Code Snippets / Screenshots

The code in question is the following

 _onKeyboardShown(event) {
        if (!this.props.avoidKeyboard) {
            return;
        }

        this._storeKeyboardPosition(event.endCoordinates.screenY);

        const node = TextInput.State.currentlyFocusedInput();

        if (node != null) {
            UIManager.viewIsDescendantOf(node, findNodeHandle(this._content), (isDescendant) => {
                isDescendant && this.scrollIntoView(node);
            });
        }
    }

Specifically UIManager.viewIsDescendantOf infinitely gets called.