octopitus / rn-sliding-up-panel

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

Panel won't show when onFocused event triggered #135

Open abdelfattah10 opened 5 years ago

abdelfattah10 commented 5 years ago

This will not work

<TextInput onFocus={() => this._panel.show()} />

And after passing avoidKeyboard={false} prop, animation is very laggy.

octopitus commented 5 years ago

Can try setTimeout?

setTimeout(() => {
  this._panel.show();
}, 240)

This is actually just wait for the keyboard is shown up before triggering the animation. I suggest don't show the panel when focus on text input. When the keyboard is showing up, it changes the layout and cause the panel calculates its next position wrongly.

drac94 commented 4 years ago

Showing the panel when text input is focused would be a great feature, so something like this can be achieved.

maps

The timeout "hack" works but seems not optimal.

P.S. thanks for the awesome work.