shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
58.6k stars 3.2k forks source link

[bug]: Can't scroll to a section with an id using Link comp inside both Sheet and Drawer #3536

Open ahmedkhabar opened 3 weeks ago

ahmedkhabar commented 3 weeks ago

Describe the bug

I'm working on a landing page and I want to add the posibility to navigate between page sections using links and sections Id, but when I start working on responsive I used sheet and when I add links inside it, when the sheet closed I had an expected scrolling to top. So I try to use Drawer insted but drawer doesn't scroll at all. Screenshot (54) Screenshot (55)

Affected component/components

Drawer, Sheet

How to reproduce

  1. Create a page and include some sections with id.
  2. Create a sidebar using sheet or drawer
  3. Add some links inside them and in the href add #section_id, and each link should be inside a DrawerClose or SheetClose

Source Code Issue Link

https://github.com/ahmedkhabar/shadcn-issue

Logs

No response

System Info

Windows 10 64 bit
Microsoft Edge
NextJS 14
App Router

Before submitting

hrishikeshmane commented 2 days ago

+1

hrishikeshmane commented 2 days ago

@ahmedkhabar how did you fix this issue?