question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Page scroll to top when starting writing on cmd line on mobile.

See original GitHub issue

Issue 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

  1. just create a simple page with this code: jQuery(function ($, undefined) { var term = $("body").terminal(); });

  2. host this locally e.g. using liveserver on vs code.

  3. 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:open
  • Created 2 years ago
  • Comments:20 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
jcubiccommented, Feb 10, 2022

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.

1reaction
jcubiccommented, Dec 5, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found