Skip to content

Commit

Permalink
fix: item zIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
gxxgcn committed Dec 27, 2021
1 parent 96c9b75 commit 10e58a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/ScrollViewGesture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Animated, {
useSharedValue,
withDecay,
withSpring,
withTiming,
} from 'react-native-reanimated';

type GestureContext = {
Expand Down Expand Up @@ -184,9 +183,7 @@ const IScrollViewGesture: React.FC<Props> = (props) => {
panTranslation = panTranslation * 0.5;
}

translation.value = withTiming(ctx.panOffset + panTranslation, {
duration: 0,
});
translation.value = ctx.panOffset + panTranslation;
},
onEnd: (e) => {
const { velocityX, velocityY, translationX, translationY } = e;
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useOffsetX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ export const useOffsetX = (opts: IOpts, visibleRanges: IVisibleRanges) => {

const inputRange = [
-TOTAL_WIDTH,
MIN - HALF_WIDTH - startPos - 1,
MIN - HALF_WIDTH - startPos - Number.MIN_VALUE,
MIN - HALF_WIDTH - startPos,
0,
MAX + HALF_WIDTH - startPos,
MAX + HALF_WIDTH - startPos + 1,
MAX + HALF_WIDTH - startPos + Number.MIN_VALUE,
TOTAL_WIDTH,
];

Expand Down

0 comments on commit 10e58a8

Please sign in to comment.