Temzasse / react-modal-sheet

Flexible bottom sheet component built with Framer Motion to provide buttery smooth UX while keeping accessibility in mind 🪐
https://temzasse.github.io/react-modal-sheet/
MIT License
783 stars 74 forks source link

Sheet is not reopening in desktop Chrome #144

Open bamnenim-kryptonium opened 7 months ago

bamnenim-kryptonium commented 7 months ago

Environment: Windows, chrome Version 119.0.6045.107

The sheet can not be re-opened once it is closed.

react-modal-sheet

the issue is reproducible in the example page and in the code sandbox i created here

younes0 commented 7 months ago

@Temzasse @bamnenim-kryptonium happens since always and on all demos

younes0 commented 7 months ago

workaround

import { PropsWithChildren } from "react";
import Sheet from "react-modal-sheet";

interface Props extends PropsWithChildren {
  isOpen: boolean;
  setIsOpen: (isOpen: boolean) => void;
}

const BottomSheet = ({ children, isOpen, setIsOpen }: Props) => (
  <Sheet
    isOpen={isOpen}
    onClose={() => setIsOpen(false)}
    style={{
      zIndex: isOpen ? "9999999" : "-1",
      visibility: isOpen ? "visible" : "hidden",
    }}
  >
    <Sheet.Container>
      <Sheet.Content>{children}</Sheet.Content>
    </Sheet.Container>
  </Sheet>
);

export default BottomSheet;
sharpsteelsoftware commented 7 months ago

Also in Chrome if you use the Scroller and start to drag down, but not enough to actually dismiss the dialog, then the dialog will be frozen in a display space and unable to interact with site.

evist0 commented 1 month ago

This seems to relate to this issue.

Sheet does not reopen only when using prefers reduce motion, which causes the values ​​to change too quickly and AnimatePresence starts to glitch.