Skip to content

Opening shadcn dialog resets scroll to top #564

@WillSmithTE

Description

@WillSmithTE

I'm losing scroll position after adding the shadcn dialog and opening it, should this be expected to work? Could be related to #346

Steps

  1. npx create-epic-app@latest
  2. npm install lucide-react (for shadcn dialog)
  3. npx shadcn-ui@latest add dialog
  4. Add the dialog example from the shadcn docs to a point "below the fold", like this
  5. Click "open"

Expected
Dialog opens and the scroll position is preserved

Actual
Dialog opens but scroll position resets to the top

In this repo I've done that, the only change to the initial template are the shadcn dialog bits: https://github.com/WillSmithTE/dialog-scroll

dialog-scroll-reset.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions