standardnotes / markdown-basic

[Moved to https://github.com/standardnotes/app] A basic Markdown editor for Standard Notes
https://standardnotes.com
GNU Affero General Public License v3.0
11 stars 12 forks source link

Add support for synced scroll #15

Closed dagjaneiro closed 5 years ago

dagjaneiro commented 5 years ago

This PR adds support for synced scroll between the editor and preview pane.

It uses the ratio between the height of both viewports as a heuristic to keep them in sync.

Here's an example of it in action:

sme

Closes standardnotes/bounties#22

moughxyz commented 5 years ago

Very nice! I'll get around to testing this sometime early next week hopefully.

moughxyz commented 5 years ago

With regards to this feature, it works nicely except for one case:

  1. Have a somewhat long note, so it's scrollable.
  2. Scroll the left down about a flick's worth, maybe 1/10th of the scrollbar thumb size.
  3. Wait till it finishes scrolling and rests.
  4. Scroll the left with one flick all the way to the top.

The result here is that the left is at the top, but the right gets stuck somewhere along the way.

dagjaneiro commented 5 years ago

I was able to replicate what you're reporting, it almost looks like it loses some events when the user scrolls really fast. I'll see what I can do.