react-modal-sheet icon indicating copy to clipboard operation
react-modal-sheet copied to clipboard

Customer Header breaks dragging behavior

Open robertmalicke opened this issue 2 years ago • 0 comments

When using a custom Header

      <Sheet
      draggable={false}
        className='mx-4'
        isOpen={isOpen}
        onClose={() => setOpen(false)}
      >
        <Sheet.Container className=''>
          {/* <Sheet.Header className='overflow-clip rounded-t-xl border-4 border-b-0 border-neutral-800 bg-yellow-500'>
            <div
              className='mx-auto flex w-full cursor-pointer justify-center p-2 text-4xl text-black'
              onClick={() => setOpen(false)}
            >
              <MdOutlineClose />
            </div>
          </Sheet.Header> */}
          <Sheet.Header />
          <Sheet.Content className='border-4 border-t-0 border-neutral-800'>
            <Sheet.Scroller>{children}</Sheet.Scroller>
          </Sheet.Content>
        </Sheet.Container>
        <Sheet.Backdrop onTap={() => setOpen(false)} />
      </Sheet>

the dragging behavior is broken. If the user starts dragging the modal down, but enough to dismiss the dialog, then the modal will remain frozen on the screen and the entire site will be without interaction.

Going back to the standard Header fixes the issue

robertmalicke avatar Nov 25 '23 23:11 robertmalicke