Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable scroll to top after save #208

Open
pixelburst-jim opened this issue Dec 13, 2024 · 7 comments
Open

Disable scroll to top after save #208

pixelburst-jim opened this issue Dec 13, 2024 · 7 comments

Comments

@pixelburst-jim
Copy link

Please add an option to disable scroll to top after saving a code snippet. Frequently I find myself need to scroll back down after every save to continue working in the section I was in, making tweaks on the fly. I know you have the add_action script to do this but would be nice if the scroll to top was disabled by default. Thanks guys, great work on Code Snippets, been loving it!!

@sheabunge
Copy link
Member

Hi @pixelburst-jim,

Thank you for your suggestion, but at this stage this is something we are unlikely to disable by default, as many users prefer the behaviour where the page scrolls to notices when they appear. We of course recognise that not everyone does, which is why we have the add_filter solution to disable it if you prefer.

I could consider making this an option on the settings page if that would make things easier?

@brandonjp
Copy link
Contributor

@pixelburst-jim Couldn't agree more! I wrote a robust snippet to handle this in a way I like a lot better, where the notice appears, but floats at the top of the window without needing to auto scroll anywhere.

You can get it here: https://codesnippets.cloud/snippet/brandonjp/Stop-the-140

Or read more about what it does and how to customize it here: https://snipsnip.pro/s/787

@pixelburst-jim
Copy link
Author

pixelburst-jim commented Dec 15, 2024

Thank you @sheabunge and yes, having it as an option on the settings page would be great and would make the user experience better imho. Also, as @brandonjp points out, it would be great not only to stop the scroll, but to surface the notification in context with where the user is. This is the principle of his snippet, not only to stop the scroll, but to have the notificiation appear absolutely positioned with a high z-index and a slight delay.

@brandonjp, thank you for the snippet, giving it a try tonight!

@sheabunge
Copy link
Member

@brandonjp I like your solution – would you be opposed if we integrated something similar into the plugin itself? I think having a floating notice would satisfy both those who like the scroll to see visible notices, and those who dislike how it adjusts the editor position.

@brandonjp
Copy link
Contributor

Ship it! Let me know if I can help anyhow

@dsmerrikin
Copy link

@sheabunge, as I continue to use Snippets daily, I want to make another feature request which I think will also help the UX. This might be a bit more complicated but it would solve the previous problem discussed above and solve another which is related.

I have moved all of my CSS media queries to the bottom part of my CSS file and the file is quite long (but not too long). I generally work on styles desktop first and then make my way down to mobile. I know, it's not mobile first ;)

Being that I am working in the middle of the file, I make changes, save, refresh my other browser window to preview, tweak, and repeat several times. Each time, I have to scroll to the bottom to click save. Now even though the window is not scrolling to top any longer (which is great, thank you), I still have to scroll back up to where I was working in the middle of the file, many times searching for a selector or trying to remember a line number.

What if you could in essence, make the message window at the top sticky, and the button bar at the bottom sticky, so that when clicking save, I can see the message and my window does not scroll anywhere, I still have context of where I was working right in front of me because it never moved. This would be a huge win I think.

Anyway, thanks for listening and considering these requests, very much appreciated and you have a lifelong customer in me, absolutely could not work on any projects without this code snippet tool!

@brandonjp
Copy link
Contributor

brandonjp commented Dec 24, 2024 via email

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

No branches or pull requests

4 participants