Skip to content

Comments

Fix scroll sync to work in both directions#122

Open
jackcase04 wants to merge 1 commit intotanabe:mainfrom
jackcase04:main
Open

Fix scroll sync to work in both directions#122
jackcase04 wants to merge 1 commit intotanabe:mainfrom
jackcase04:main

Conversation

@jackcase04
Copy link

Hi, I noticed that when the sync scroll button is toggled, scrolling on the editor side would scroll the preview side, but scrolling on the preview side would not scroll the editor side to match it. So this pull request is a fix for that bug.

I added an preview event listener for when the preview side is scrolled, and a isScrolling flag to ensure each side does not try to scroll each other. Lastly, I bypassed the smooth scrolling on the preview side to match the way that the editor side scrolls with a mouse.

The end result is that now you can scroll on either the left or right side of the screen with Sync Scroll enabled and it will sync properly.

Hopefully this is helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant