You need to sign in to do that
Don't have an account?
SalesForce_52436
How Scroll to Top of page in component?
Hi,
I Want to scroll to top of the page to indicate that error has occured. When i am try to display the error message page is not scrolling to top when error is occured.i want to auto scroll top when error occured in lightning component.Please help me its urgent.
I Want to scroll to top of the page to indicate that error has occured. When i am try to display the error message page is not scrolling to top when error is occured.i want to auto scroll top when error occured in lightning component.Please help me its urgent.
Greetings to you!
Please refer to the below links which might help you further with the above requirement.
https://salesforce.stackexchange.com/questions/78514/scroll-to-top-in-a-lightning-component
https://salesforce.stackexchange.com/questions/197200/scroll-page-to-top-onclick-of-a-button-in-saleforce1
https://developer.salesforce.com/forums/?id=9060G0000005YtaQAE
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks and Regards,
Khan Anas
I have already seen all of these none of them is worked for me? If you got any solution please help me to write the code iam new to lightning.
Thanks
I have tried window.scroll(0,0) , this is working in lightning component but not in lightning quick action. I want to scroll to top when button is clicked in lightning quick action. PLease help me.
Thanks
Hi SalesForce_52436
i too want to scroll to top in lightning quick action please share the soln if you have found any .
it would be really helpful.
Thanks,
Try that out it should work. I was facing a similar issue while adding LWC inside Flexi Page. The Flexi page has its own scroller but for that, the scrollTop doesn't work. But if we create a separate scroller at the top-level div then the scrollTop starts to work.
Check this out. I have created this and it works perfectly fine for me: https://webcomponents.dev/edit/3vpWJ46hxykfPSACfuNN
Have you found a way to scroll to top in quick action?
I had a similar requirement , when ever we switch between tabs within a lightning page the element should be disaplaying from top of the screen instead of the position we scrolled in the previous operation.
Your solution has worked perfect for me. Thank you..
declaration at top: and then in my function: