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

fix: apply panGestureHandlerProps to gesture #466

Closed

Conversation

adamhari
Copy link
Contributor

fixes #465

@changeset-bot
Copy link

changeset-bot bot commented Aug 30, 2023

🦋 Changeset detected

Latest commit: 77caa06

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-native-reanimated-carousel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

.onUpdate(onGestureUpdate)
.onEnd(onGestureFinish);

const {
Copy link
Contributor Author

@adamhari adamhari Aug 30, 2023

Choose a reason for hiding this comment

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

destructure panGestureHandlerProps, we need to handle each separately, we cannot iterate over them and call the functions on Gesture.Pan() dynamically because the function and prop names do not all match

@@ -1,11 +1,11 @@
import type { PropsWithChildren } from "react";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Formatted with the repo's prettier config

validStart,
touching,
]);
if (typeof activeOffsetXStart === 'number' || typeof activeOffsetXEnd === 'number') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

check type instead of truthiness in case the provided value is falsey and the default value is not

@hk-skit
Copy link

hk-skit commented Oct 12, 2023

@dohooo . If this change looks good to you, can you please merge and roll this out? Thanks.

@BrodaNoel
Copy link
Contributor

Feel free to ask for help in the testing. I can include the new release in my next build and see what happens

@0xFA11
Copy link

0xFA11 commented Oct 23, 2023

@dohooo +1 on this issue, it's very much needed for the basic functionality — and it looks like it's good to go!

@YuGer26
Copy link

YuGer26 commented Oct 30, 2023

I tried it, but it didn't work. activeOffsetX: [-10, 10] still doesn't work.

@adamhari
Copy link
Contributor Author

I tried it, but it didn't work. activeOffsetX: [-10, 10] still doesn't work.

try activeOffsetXEnd activeOffsetXStart

@YuGer26
Copy link

YuGer26 commented Oct 31, 2023

I tried it, but it didn't work. activeOffsetX: [-10, 10] still doesn't work.

try activeOffsetXEnd activeOffsetXStart

panGestureHandlerProps={{
activeOffsetXEnd: 10,
activeOffsetXStart: -10,
}}
good job

@BrodaNoel
Copy link
Contributor

BrodaNoel commented Oct 31, 2023

I just tried this, and it's NOT working on iOS, inside a modal:

panGestureHandlerProps={{
  // activeOffsetX: [-10, 10],
  activeOffsetXEnd: 10,
  activeOffsetXStart: -10,
}}

@Kieraano
Copy link

Kieraano commented Nov 1, 2023

I can confirm this PR fixes the issue for v4, at least outside of Modals. 👍

I recommend merging this and dealing with the modal issue separately.

@YuGer26
Copy link

YuGer26 commented Nov 2, 2023

我刚刚尝试过这个,它在 iOS 上不起作用,在模态中:

panGestureHandlerProps={{
  // activeOffsetX: [-10, 10],
  activeOffsetXEnd: 10,
  activeOffsetXStart: -10,
}}

I just tried this, and it's NOT working on iOS, inside a modal:

panGestureHandlerProps={{
  // activeOffsetX: [-10, 10],
  activeOffsetXEnd: 10,
  activeOffsetXStart: -10,
}}

in FlatList is ok

replaces PanGestureConfig with PanGestureHandlerProps
@dohooo
Copy link
Owner

dohooo commented Dec 3, 2023

Solved in #493, THX for your effort.

@dohooo dohooo closed this Dec 3, 2023
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.

Vertical scroll not working anymore in 4.0.0-alpha.0
8 participants