Skip to content

Conversation

@lsdimagine
Copy link
Collaborator

Please provide enough information so that others can review your pull request:

I added isScrollEnded in bottom sheet internal state. So when setting scrollable, we can keep isScrollableLocked if scrollable is still scrolling. It's possible that scrollable is updated when it's being scrolled, in this case we shouldn't interrupt the lockable state.

);
const isScrollableRefreshable = useSharedValue<boolean>(false);
const isScrollableLocked = useSharedValue<boolean>(true);
const isScrollEnded = useSharedValue<boolean>(true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Before this PR, isScrollEnded was initialized to false, but now it's initialized to true. It seems to make more sense as true, but I'm worried that might cause some issues with the existing code unrelated to the isScrollableLocked logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's only used in scroll handlers and being set on drag begins, so I think the initial value doesn't really matter here https://github.com/discord/react-native-bottom-sheet/blob/discord-fork-4.5.1/src/hooks/useScrollEventsHandlersDefault.ts#L106

@lsdimagine lsdimagine merged commit d734394 into discord-fork-4.5.1 Feb 5, 2024
@yayvery yayvery deleted the lsdimagine/handle_scrollable_update branch February 24, 2024 19:14
yayvery pushed a commit that referenced this pull request Feb 24, 2024
yayvery pushed a commit that referenced this pull request Mar 13, 2024
ghost pushed a commit that referenced this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants