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

Editor scrolls to the top with every stroke under certain conditions #436

Closed
erquhart opened this issue Jun 1, 2017 · 7 comments
Closed
Assignees
Milestone

Comments

@erquhart
Copy link
Contributor

erquhart commented Jun 1, 2017

- Do you want to request a feature or report a bug?

bug

- What is the current behavior?

When an image in the editor preview pane is taller than the viewport, and there's not much other content, whenever the preview pane rerenders (every input change and field focus change) the remaining content finishes rendering before the image, causing the preview pane to scroll to the top due to lack of content. The control pane then scrolls to stay synced.

- If the current behavior is a bug, please provide the steps to reproduce.

In the CMS example project:

  • shrink the viewport height to something short, maybe 1000px or so
  • upload a large image as the featured image
  • try to enter text in the body field

- What is the expected behavior?

Not this.

@erquhart
Copy link
Contributor Author

erquhart commented Jun 1, 2017

cc/ @jholmes033169

@Dammmien
Copy link
Contributor

Dammmien commented Aug 8, 2017

In the Kitchen Sink entry you can note that the editor is scrolled to the bottom when the page is loaded. If you disable the visual editor component and replace it by the raw editor, the issue disappear. It seems to be linked to a prosemirror issue and more generally to the contenteditable behavior ...

Any idea of workaround ?
Maybe set the editor in raw mode by default, but it's not a very user-friendly.

@tortilaman
Copy link
Contributor

tortilaman commented Aug 9, 2017

I ran into this bug this morning when I was a text widget within a list widget that had an image populated. I guess it's not related to that specific implementation though necessarily. I'll follow the rabbit hole later in the day if I have time to confirm it's the same issue as here.

@Dammmien
Copy link
Contributor

Dammmien commented Aug 10, 2017

In fact there is 2 different issues :

  • The editor is scrolled to the bottom when the page is loaded due to prosemirror.
  • When you have a large image the rendering of the preview trigger a scroll event. It makes the editor scrolls to the top due to syncing.

@verythorough
Copy link
Contributor

Added #532 as a possibly lower-hanging stopgap for this issue.

@erquhart
Copy link
Contributor Author

I believe this may be addressed under #254:

  • Using Slate instead of Prosemirror, so no more jumping to bottom on load
  • Widgets in the preview pane are now only updating when their value has changed

@erquhart erquhart self-assigned this Sep 13, 2017
@erquhart
Copy link
Contributor Author

Closed in #254.

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

4 participants