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

<PanelRenderer/> will always autoscroll to bottom on re-render #86997

Open
maroparo opened this issue Apr 26, 2024 · 0 comments
Open

<PanelRenderer/> will always autoscroll to bottom on re-render #86997

maroparo opened this issue Apr 26, 2024 · 0 comments

Comments

@maroparo
Copy link

It is not possible for the <PanelRenderer/> to save the scrolling state between renders. This causes the content to be autoscrolled at the end whenever new content is rendered in the scrolling container within the component.

Why is this needed:

In the Grafana k6 Cloud Plugin, one of the usages of the <PanelRenderer/> is to render a list of logs of a test run. In case the test is still running and the user is analysing the logs whilst the logs list is updating, the content will be scrolled to the bottom to show new content, and the user will have to scroll up to the log entry they are examining. Depending on the frequency of refreshing the logs (in our case is quite often), the user will have very little time to exam the log of interest until the content is autoscrolled to the bottom with the new re-fetch. This makes examining logs while the test is running pretty hard.
Have a look at this GIF:
k6-test-run-logs-panel-render-autoscrolling-to-bottom

What would you like to be added:

Either

  • (easiest and case specific) have a way to pass down a ref object to the scrollable container, so its possible to memorise the scrolling position
  • have a prop which controls the scrolling behaviour. memorise | scrollToTop | scrollToBottom (or something similar)

Who is this feature for?

Not sure how to answer this, but if this is a unique issue than I'd say the k6 plugin in this specific case. But I suppose it would be an issue for all applications where content is displayed that frequently updated with fresh content.

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

1 participant