Scroll to top of Dialog
See original GitHub issue- [ x] I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
I’m rendering a pretty long component within the dialog, and am using the autoscroll functionality to get the overflow-y: auto
styling in the dialog content. At certain points, the component moves to the the next step, and I would like to instantly go to the top of the dialog content.
I saw that jQuery’s scrollTop function can be used to get to the top of a component, but I’m unsure how to reference the dialogContent div. Please advise.
Current Behavior
Currently, when the component changes, the scroll remains the same, and the result is that the user sees a lower part of the new component.
Your Environment
Tech | Version |
---|---|
Material-UI | 0.17.4 |
React | 15.3.2 |
browser | Chrome |
etc |
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to get jQueryui dialog scrollTop to scroll dialog content to ...
Try $("#the_dialog_div").scrollTop("0"). This worked for me!
Read more >Scroll to top of Dialog · Issue #9186 · mui/material-ui - GitHub
I saw that jQuery's scrollTop function can be used to get to the top of a component, but I'm unsure how to reference...
Read more >How to scroll on the top of modal - Salesforce Stack Exchange
i have a modal popup with scrolling, i am trying to scroll the user to the top of the modal when the user...
Read more >scrollbar positioned at top of dialog after scrollTop()
I launch a jQuery UI modal Dialog containing an iframe. The contained document has anchors with corresponding navigational links. When a link is ......
Read more >modal scrolls to top (I explain why) - WordPress.org
The browser (chrome in my case) scrolls to the top because you've set the height of the content to the same as the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you want to manipulate the
scrollPosition
yourself programmatically, you need to use the Ref Callback pattern to have access to that DOM element directly.Check StackOverflow and similar sources for other questions on how to use the library. 😄
I was able to get this working using @achikin solution. Just nest a div inside of dialog content then render another dialog content.