Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: allow closing sheets from ref when using SheetManager#444

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
code-504 wants to merge1 commit intoammarahm-ed:master
base:master
Choose a base branch
Loading
fromcode-504:fix/sheetmanager-ref-id-mismatch
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletionssrc/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -268,15 +268,15 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
...config,
velocity: typeof velocity !== 'number' ? undefined : velocity,
}).start();
}else {
}else {
Animated.spring(animations.translateY, {
toValue: initialValue.current,
useNativeDriver: true,
...config,
velocity: typeof velocity !== 'number' ? undefined : velocity,
}).start();
}

notifySnapIndexChanged();
},
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand DownExpand Up@@ -349,7 +349,9 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
if (drawUnderStatusBar || props.onChange) {
animationListener = animations.translateY.addListener(value => {
const correctedValue =
value.value > minTranslateValue.current ? value.value - minTranslateValue.current : 0;
value.value > minTranslateValue.current
? value.value - minTranslateValue.current
: 0;
props?.onChange?.(correctedValue, actionSheetHeight.current);
if (drawUnderStatusBar) {
if (lock.current) return;
Expand DownExpand Up@@ -772,7 +774,12 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
}
},
onGestureEvent(event) {
if (sheetId && !isRenderedOnTop(sheetId, currentContext)) return;
if (
sheetId &&
id === sheetId &&
!isRenderedOnTop(sheetId, currentContext)
)
return;

const gesture = event.nativeEvent;
let deltaY = gesture.translationY;
Expand DownExpand Up@@ -1004,7 +1011,11 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
? {panHandlers: {}}
: PanResponder.create({
onMoveShouldSetPanResponder: (_event, gesture) => {
if (sheetId && !isRenderedOnTop(sheetId, currentContext))
if (
sheetId &&
id === sheetId &&
!isRenderedOnTop(sheetId, currentContext)
)
return false;
let vy = gesture.vy < 0 ? gesture.vy * -1 : gesture.vy;
let vx = gesture.vx < 0 ? gesture.vx * -1 : gesture.vx;
Expand All@@ -1023,7 +1034,11 @@ export default forwardRef<ActionSheetRef, ActionSheetProps>(
return true;
},
onStartShouldSetPanResponder: (_event, _gesture) => {
if (sheetId && !isRenderedOnTop(sheetId, currentContext))
if (
sheetId &&
id === sheetId &&
!isRenderedOnTop(sheetId, currentContext)
)
return false;
const activeDraggableNodes = getActiveDraggableNodes(
_event.nativeEvent.pageX,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp