Instant Scroll to Top without animation
Learn how to optimize your Bubble.io one page app by implementing a simple JavaScript solution to address the scroll to top issue when changing custom states.
Unlock the secret to smooth scrolling: Learn how to instantly jump to the top of your one-page Bubble app without annoying animations!
Master custom states in Bubble: Discover the simple JavaScript trick to enhance user experience in your responsive web app design.
Tired of clunky page transitions? Transform your Bubble app's navigation with this game-changing custom CSS solution!
Custom States and Scroll to Top Issues in Bubble One-Page Apps
If you're building a Bubble one-page app and you're encountering an issue where when you change custom states to change what screen within the single page your user is looking at and you're having an issue with scroll to top, then this video is for you. I came off a Bubble Coaching call earlier on the week and the person I was working with was encountering this exact issue. Let me show you.
Demonstrating the Scroll Issue
We've got a really long bit of content on our dashboard, but then I want to swap to orders and I've also got a very long bit of content on my orders and like you can see it doesn't scroll up to the top of the page now. You may be thinking ah Matt, there's a very easy solution to this which would be we can use these scroll to.
Attempting a Solution with Scroll To
So I changed my custom state here and then I say scroll to an element. Now generally speaking, the secret here if you want to scroll to the top is you just select the page itself. So let's try that and you're gonna see this is still less than optimal go to orders. Oh and we have a... Especially if you're building what is meant to look like a or behave like a native mobile app or a responsive web app. Yeah, this is not great behavior.
Alternative Approach Using URL Parameters
And in actual fact if you decide if you weren't about this a different way instead of using custom states to dictate which group is shown if you were to use URL parameters turns out this isn't an issue. And you can follow a link down in the description to go and learn and find our videos where we use URL parameters to build one page apps.
Implementing a JavaScript Solution
But let's put together a solution for custom states. So go back into editor and we're going to need to add in a bit of JavaScript. So I'm gonna go plugins and make sure that I have got the Tool tool kit toolbox. Maybe I've not got it installed. Toolbox okay because toolbox allows you to run JavaScript in workflows. So now if I go to my workflow I can say run JavaScript and I'm gonna paste in this tiny bit of JavaScript asynchronously. That's gonna make much difference in this case right now, let's see how it behaves.
Testing the JavaScript Solution
So I'm on dashboard scroll down. I'm gonna click orders. Boom straight up to the top the JavaScript runs instantly. There's no animation. Let's try again. Let's go back to dashboard. Boom, okay, and get tired saying boom straight up to the top.
Conclusion
So there we go. That's how to counter a common frustration that I've seen with several Bubble coaches about using one page apps and custom states in Bubble because you can just use this tiny bit JavaScript to jump right up to the top of the page without any animation involved.
The best way to learn Bubble.io?
Start building with total confidence
No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.
Find every solution in one place
No more searching across platforms for tutorials. Our bundle has everything you need, with 500+ videos covering every feature and technique.
Dive deep into every detail
Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.

Frequently Asked Questions
Find answers to common questions about our courses, tutorials & content.
No. Our Beginner Essentials course and AI No-Code Coach are designed for total newcomers. You’ll learn Bubble.io step by step - no coding required.
Simply type your question in plain English, and our AI taps into the entire video library to recommend the exact lessons you need. It’s like having a personal instructor on demand.
As long as you’re subscribed! With our monthly subscription, you get unlimited access to all 500+ videos, our growing course library, and the AI No-Code Coach.
Your subscription includes:
- Bubble Beginner Essentials – Get up and running fast.
- Build a ChatGPT Clone – Integrate AI into your no-code apps.
- Build Your SaaS Website with AI – Learn to create a scalable startup site.
Plus, new tutorials every week!
The AI No-Code Coach is your first stop for instant answers. If you need deeper help, you can book 1:1 Bubble coaching for expert guidance.
Yes! If you don’t see real progress within 14 days, let us know, and we’ll issue a full refund—no questions asked.
Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.
Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.
If you’re serious about building a successful SaaS startup, check out Mastery—our intensive mentorship program. Mastery goes beyond Bubble.io development and includes:
- 1:1 mentorship to fast-track your progress
- Marketing strategies tailored for no-code founders
- Product management insights to scale your startup
- Personalized support from experienced founders