plotly / plotly/dash

[Feature Request] Condition dcc.Link's window.scrollTo(0,0) on a component prop

Open
#3,974 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement P3 size: 1
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

Is your feature request related to a problem? Please describe.
Occasionally a dcc.Link will update the URL, though only some portion of the layout will be updated. However, the page will still scroll to the top.

Describe the solution you'd like
dcc.Link currently calls window.scrollTo(0,0) unconditionally. It could be nice for that to be conditional, perhaps controlled by a prop.

Describe alternatives you've considered
None.

Additional context
None.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with components/dash-core-components/src/components/Link.tsx, especially the dcc.Link navigation path that currently calls window.scrollTo(0,0) unconditionally. Trace how Link props are defined and consumed, then verify that the new prop can control scrolling while preserving URL and layout updates; the issue does not name a test file to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.