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

Adjust onSettle index of Bottomsheet (49) #947

Open
wants to merge 1 commit into
base: 49
Choose a base branch
from

Conversation

sieu-db
Copy link
Collaborator

@sieu-db sieu-db commented Aug 28, 2024

🚀 This description was created by Ellipsis for commit 6e73ad4

Summary:

Updated BottomSheet to use direct index for onSettle callback, removing index reversal logic.

Key points:

  • Updated onChange in packages/core/src/components/BottomSheet/BottomSheet.tsx to use the direct index for onSettle callback.
  • Removed index reversal logic in onChange function.
  • Added onSettle logging in example/src/BottomSheetExample.tsx to demonstrate new behavior.

Generated with ❤️ by ellipsis.dev

Copy link

linear bot commented Aug 28, 2024

@@ -109,7 +109,7 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
borderWidth,
borderColor: borderColor ?? theme.colors.border.brand,
}}
onChange={(index) => onSettle?.(mappedSnapPoints.length - index - 1)}
onChange={(index) => onSettle?.(index)}
Copy link

Choose a reason for hiding this comment

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

The initialSnapIndex logic still uses the reversed index logic (mappedSnapPoints.length - initialSnapIndex - 1). This might lead to inconsistencies with the onSettle callback behavior. Consider aligning this logic with the new onChange behavior.

@sieu-db sieu-db changed the title Adjust onChange index of Bottomsheet (49) Adjust onSettle index of Bottomsheet (49) Aug 28, 2024
Copy link

Published version: @draftbit/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant