-
Notifications
You must be signed in to change notification settings - Fork 734
Drawer - trigger onToggleSwipeLeft on releases #860
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why, but the PR show only some of the changes in the code, it's really confusing. Hope I didn't miss anything..
src/components/drawer/Swipeable.tsx
Outdated
@@ -303,8 +303,8 @@ export default class Swipeable extends Component<PropType, StateType> { | |||
} | |||
}); | |||
|
|||
if (toValue === rowWidth * LEFT_TOGGLE_THRESHOLD && onToggleSwipeLeft) { | |||
onToggleSwipeLeft({rowWidth, leftWidth}); | |||
if ((toValue === rowWidth * LEFT_TOGGLE_THRESHOLD || this.dragFired) && onToggleSwipeLeft) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I wasn't sure where this comes from (this.dragFired
) I think the PR is missing some of the code changes.
Anyway, the name of the variable was a little confusing to me.
Is the flag purpose is to mark when the drag exceed threshold? if so, consider renaming it..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@ethanshar This is a second PR for this ticket. The first was merged and this is the changes UX ask for so maybe that's why you think some of the changes are not showing in the code? |
Fix for trigger event on release instead of just threshold