Skip to content

Preview scrollbar changes position so that entered text is not visible #3047

@tyilo

Description

@tyilo

Current behavior

When typing something after a large image, the preview scrolls back to the top instead of staying at its current location, so you can see the output of what you type. I don't know if it can be triggered without an image.

Enabling or disabling the "When scrolling, synchronize preview with editor" option, doesn't fix the problem.

Before step 3 (below):
Before step 3

After step 3 (below):
After step 3

Expected behavior

The preview's scrollbar doesn't change position.

Steps to reproduce

  1. Create a new snippet and paste the following:
# Test

A

![892ea562.png](:storage/ea2f7416-c3c2-478a-b65d-7f930e9f8174/892ea562.png)

B

Here the image is a very high image, higher than your screen's height. (You can use: https://transfer.sh/11osU9/892ea562.png)

  1. Enable preview and scroll down to the bottom of the preview, so you can see "B".
  2. Type something after "B".
  3. The preview's scrollbar scrolls up to the top, so you can't see the result of what you are typing.

Environment

  • Version : 0.11.16
  • OS Version and name : Arch Linux

I think it might be a good idea to an option to never change the position of the scrollbar of the preview pane, when typing in the editor pane. (No smart algorithm to figure out where the best scrolling position is, but just remembering position before rendering and then restoring that position after re-rendering).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Issue concerns a bug.level 1 ❕A bug that caused minor damage: App is still usable, but minor features might not work.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions