Skip to content

The Sheet Component, after closing the sheet it always make unexpect scrolling down. #2127

Answered by PrinOrange
PrinOrange asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you very much for your ardent help.
I have tried your solution and make subtle improvements then it works, although it's just a temporary solution.
I have give up using the <SheetTrigger> and <SheetClose> to control whether open the Sheet, and replace it with useState usage

const [isTOCOpen, setIsTOCOpen] = useState(false);
return (
        <Sheet open={isTOCOpen}>
              <Link
                className="hover:text-sky-500"
                onClick={(e) => {
                  setIsTOCOpen(false);
                }}
                key={`toc-${item.anchorId}`}
                href={`#${item.anchorId}`}
              >
                <li
                  className="my-2 text-s…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@PrinOrange
Comment options

Answer selected by PrinOrange
@onurhan1337
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@whoisjuandev
Comment options

@Benrise
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants