Skip to content

Add configurable scroll-to-top behavior to dcc.Link - #3976

Open
CNFeffery wants to merge 2 commits into
plotly:devfrom
CNFeffery:dev
Open

Add configurable scroll-to-top behavior to dcc.Link#3976
CNFeffery wants to merge 2 commits into
plotly:devfrom
CNFeffery:dev

Conversation

@CNFeffery

Copy link
Copy Markdown
Contributor

This PR makes the automatic scroll-to-top behavior of dcc.Link configurable.

  • Add a new boolean scrollToTop prop that defaults to true, preserving the existing behavior.
  • Only call window.scrollTo(0, 0) when scrollToTop is enabled.

Closes #3974

@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

@AnnMarieW

Copy link
Copy Markdown
Collaborator

Nice PR!
Just chiming in here...

What do you think about naming the prop scrollTo (or scroll_to) and allowing the arguments supported by Element.scrollTo ?

It could default to the current behavior, scrollTo(0, 0), and also allow the options dict with top, left, and behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants