Skip to content

Commit 50cc01d

Browse files
jayuosdnk
authored andcommitted
fix: snapTo inside sheet content android (#119)
Hi, as many folks here I was facing an issue with using snapTo on a touchable element inside sheet content. In my case, it was a button based on TouchableOpacity. After a few hours of debugging, I found that on Android whenever any touchable element inside sheet is beeing touched this.panMasterState is not END but CANCELLED. That's why cond that should start spring animation is not evet evaluated. I think this closes at least #76 #16 #69
1 parent 08e3d43 commit 50cc01d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,10 @@ export default class BottomSheetBehavior extends React.Component<Props, State> {
374374
const wasRun: Animated.Value<number> = new Value(0)
375375
this.translateMaster = block([
376376
cond(
377-
eq(this.panMasterState, GestureState.END),
377+
or(
378+
eq(this.panMasterState, GestureState.END),
379+
eq(this.panMasterState, GestureState.CANCELLED)
380+
),
378381
[
379382
set(prevMasterDrag, 0),
380383
cond(

0 commit comments

Comments
 (0)