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

Dragging the Vaul doesn't change the snap point #225

Closed
noskovvkirill opened this issue Jan 22, 2024 · 0 comments · Fixed by #227
Closed

Dragging the Vaul doesn't change the snap point #225

noskovvkirill opened this issue Jan 22, 2024 · 0 comments · Fixed by #227

Comments

@noskovvkirill
Copy link

noskovvkirill commented Jan 22, 2024

Hi! Thanks for building Vaul. We see an issue when the user drags the bottom sheet it doesn't stick to the new position while short swipes work.

You can see it in the attached video.

IMG_0106.MOV

const ReactionsList = memo(
  ({
    reactions,
    isOpen,
    setIsOpen,
  }) => {
    const [activeSnapPoint, setActiveSnapPoint] = React.useState<
      number | null | string
    >(0.5);
    return (
      <Drawer.Root
        scrollLockTimeout={0}
        open={isOpen}
        closeThreshold={0.1}
        setActiveSnapPoint={setActiveSnapPoint}
        activeSnapPoint={activeSnapPoint}
        onClose={() => setIsOpen(false)}
        onOpenChange={(open) => {
          if (open) {
            setIsOpen(true);
          } else {
            setIsOpen(false);
          }
        }}
        dismissible={true}
        snapPoints={[0.5, 1]}>
        <Drawer.Portal>
          <Drawer.Content className="pt-safe fixed bottom-0 left-0 h-full w-full">
            <Header/>
            <Virtuoso
              style={{ height: '100%' }}
              data={reactions}
              overscan={100}
              itemContent={(_, reaction) => {
                return (
                  <List
                    onClick={() => {
                     // on click action
                    }}>
                    {reaction.name}
                  </List>
                );
              }}
            />
          </Drawer.Content>
        </Drawer.Portal>
      </Drawer.Root>
    );
  },
);

Below is an example of how the bottom sheet works in Discord

IMG_0107.MOV

On a side note, we also wish the scrolling within a container would change a breakpoint and expand the bottom sheet.

@noskovvkirill noskovvkirill changed the title Dragging the Vaul Dragging the Vaul doesn't change the snappoint Jan 22, 2024
@noskovvkirill noskovvkirill changed the title Dragging the Vaul doesn't change the snappoint Dragging the Vaul doesn't change the snap point Jan 22, 2024
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 a pull request may close this issue.

1 participant