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.

Scroll position/moveTo() issue

See original GitHub issue

Hi there.

I am trying to design a “teminal-style” pane which displays incoming data from a serial port, using a StyleTextArea object.

New text is appended onto the end of the StyleTextArea object and removed from the beginning, to keep the total number of characters in the view the same.

I want the user to be able to scroll to say, halfway, and have the text he/she sees remain constant. Keeping the current view constant is easy if I had a way of finding what value moveTo() would result in the current view, as I can count how many characters have been removed, and then call moveTo() again with newValue = oldValue - numCharsRemoved.

If there any way to achieve this functionality? I was able to do it with a normal TextFlow node using the scrollY value (when it was wrapped in a ScrollPane), but since I read that getEstimatedScrollY() on a VirtualizedScrollPane does not work correctly if their are font size changes or wrapped lines, I’m not sure if I can rely on this.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JordanMartinezcommented, Nov 16, 2016

It sounds somewhat similar to #385.

0reactions
JordanMartinezcommented, Mar 17, 2017

Closing as this should be resolved for the most part by #418.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I retain the scroll position of a scrollable area when ...
During page unload, get the scroll position and store it in local storage. Then during page load, check local storage and set that...
Read more >
How to Get and Set Scroll Position of an Element
To get or set the scroll position of an element, you follow these steps: First, select the element using the selecting methods such...
Read more >
Scroll-Then-Fix Content | CSS-Tricks
Search bar in its scrollable position; Search bar in its fixed header position. We toggle between them simply by changing a class name....
Read more >
How to Change the Position of Scrollbar using CSS
We can use the CSS “::-webkit-scrollbar” property which is responsible for changing the shape, color, size, shade, shadow, etc. of the scroll ......
Read more >
Preserve scroll position in prototypes - Figma Help Center
Preserve scroll position is not available for Slide, Push, or Move animations. Vertical scroll. In our example below, we want to show the...
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