Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined is not an object (evaluating 'this._panel.transitionTo') #206

Open
ajoykarmakar459 opened this issue Aug 28, 2021 · 0 comments
Open

Comments

@ajoykarmakar459
Copy link

ajoykarmakar459 commented Aug 28, 2021

You can manually call to transactionTo inside onDragEnd event (It's invoked with the current position of the panel) with some conditions e.g. did user scroll over half of draggable range? If yes, then scroll to top, otherwise scroll back to bottom.

_handleOnDragEnd(position) {
  if (position > 640/2) {
    this._panel.transitionTo(640)
  } else {
    this._panel.transitionTo(0)
  }
}

<SlidingUpPanel
  ref={c => this._panel = c}
  draggableRange={{top: 640, bottom: 0}}
  onDragEnd={this._handleOnDragEnd}
/>

_Originally posted by @octopitus in https://github.com/octopitus/rn-sliding-up-panel/issues/39#issuecomment-374865105_```



This code is not working anymore. What's the replacement for this code?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant