octopitus / rn-sliding-up-panel

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

currentlyFocusedInput deprecated #184

Closed Dellybro closed 3 years ago

Dellybro commented 4 years ago

Issue Description

Line 315 of slidingUpPanel.js needs to be edited

const node = TextInput.State.currentlyFocusedField()

should be

const node = TextInput.State.currentlyFocusedInput()
keeprock commented 4 years ago

It's not that easy to fix, as my experience shows. Changing to currentlyFocusedInput results in that kind of error:

image

keeprock commented 4 years ago

It happen because of this code:

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

viewIsDescendantOf waits for reactTag (number) which is a reference to a react fiber element. But, currentlyFocusedInput returning object, and that break things.

image

keeprock commented 4 years ago

You can track progress on this issue on this PR:

https://github.com/octopitus/rn-sliding-up-panel/pull/185

octopitus commented 3 years ago

Fixed in v2.4.4

mwerder commented 3 years ago

@octopitus when will v2.4.4 be released? latest on npm is still 2.4.3

octopitus commented 3 years ago

@mwerder Sorry forgot to publish new verison. Should have been updated.