Page scroll to top when starting writing on cmd line on mobile.
See original GitHub issueIssue summary
On mobile, If you write a lot of commands and the page gets bigger, you need to scroll to bottom to see the command line because the virtual keyboard hides it. Then when writting new commands the page automatically scrolls to top and you need to scroll to bottom to see the command line again.
Expected behavior
The page should stay focused on the current command line cursor
Actual behavior
The page auto scrolls to top when writing
Steps to reproduce
-
just create a simple page with this code:
jQuery(function ($, undefined) { var term = $("body").terminal(); });
-
host this locally e.g. using liveserver on vs code.
-
Execute commands to get the page bigger. Scroll to bottom to see the command line. Then write something again. The page will scroll to top automatically.
Browser and OS
Chrome, Firefox on iOS 15.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:20 (12 by maintainers)
Top Results From Across the Web
How to scroll in a terminal using keyboard?
Ctrl + Shift + Up or Ctrl + Shift + Down to go up/down by line. Share.
Read more >Scrolling Up and Down in the Linux Terminal
In the Linux terminal, you can scroll up by page using the Shift + PageUp shortcut. And to scroll down in the terminal,...
Read more >How to Scroll Up in Linux Screen - Small Business - Chron.com
Press the "Up" and "Down" arrow keys or the "PgUp" and "PgDn" keys to scroll through previous output. 3. Press "Esc" to exit...
Read more >javascript - How to jump to top of browser page - Stack Overflow
You can set the scrollTop , like this: $('html,body').scrollTop(0);. Or if you want a little animation instead of a snap to the top:...
Read more >scrollTo | Cypress Documentation
Scroll to a specific position. It is unsafe to chain further commands that rely on the subject after .scrollTo(). Syntax Usage Correct Usage...
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
Maybe iOS sucks because Apple doesn’t care. It’s really a pain to create a working solution for mobile.
Anyway, I will try to solve the issue, I think that the only option is to use JavaScript. I said that I’m closer because I was able to detect the height of the page on iOS (without the keyboard), the problem is that it doesn’t work for Android, so I will probably need to use User-Agent sniffing to detect iOS and apply that JavaScript only for Apple OS.
It may take quite some time to fix unless someone will be able to help. There is only a need to detect the height of the screen without the virtual keyboard that will work on both Android and iOS.
I will play with it again and see how it will go, it’s a slow process.
Sorry, it don’t have any solution. I was trying few things and was not able to find any. I also have issue with scrollbar even on Android, but that’s maybe with my demo.