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

feat: add bottom clamp option #108

Merged
merged 6 commits into from Oct 23, 2019
Merged

feat: add bottom clamp option #108

merged 6 commits into from Oct 23, 2019

Conversation

sebqq
Copy link
Contributor

@sebqq sebqq commented Oct 16, 2019

If enabledBottomClamp is set to true, user is not able to overdrag panel above its minimal snappoint value, so panel behaves like the one from original Apple Maps app.

How it looks like?

2019-10-16 20 03 39

@osdnk
Copy link
Owner

osdnk commented Oct 17, 2019

Looks cool, but please note that values inside nodes are not reactive. They won’t update on changing props. Please use animated values instead and update in componentDidUpdate method.

@sebqq
Copy link
Contributor Author

sebqq commented Oct 18, 2019

Well, thank you! I will look at it ASAP

@Annihil
Copy link
Contributor

Annihil commented Oct 18, 2019

Wow that's exactly what I need, how handy! 😊

@sebqq
Copy link
Contributor Author

sebqq commented Oct 18, 2019

@osdnk I've made proposed changes. Does it look better now?

src/index.tsx Outdated
@@ -358,6 +366,11 @@ export default class BottomSheetBehavior extends React.Component<Props, State> {
// current snap point desired
this.snapPoint = currentSnapPoint()

if (props.enabledBottomClamp) {
this.clampingEnabled.setValue(1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move it directly to declaration :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@osdnk I'm not totally sure if you meant animation declaration or class declaration but hopefully I got you right :)

@Annihil
Copy link
Contributor

Annihil commented Oct 23, 2019

I desperately need this, may I help with anything?

@sebqq
Copy link
Contributor Author

sebqq commented Oct 23, 2019

If you need this immediately you can still use my fork :)

yarn add https://github.com/sebinq/react-native-reanimated-bottom-sheet.git#cb81659d37322f341841c4f5f67d657841bed874

@Annihil
Copy link
Contributor

Annihil commented Oct 23, 2019

bottomsheet

I can confirm it is working fine, I believe that is good to go 🙂

Copy link
Owner

@osdnk osdnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Please, next time don't use -n!

@osdnk osdnk changed the title [Feature] Add bottom clamp option feat: add bottom clamp option Oct 23, 2019
@osdnk osdnk merged commit c015297 into osdnk:master Oct 23, 2019
osdnk pushed a commit that referenced this pull request Oct 23, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants