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

Empty lines at the bottom of the scrolled area break the mirroring #11

Open
aderchox opened this issue Jan 17, 2024 · 2 comments
Open

Comments

@aderchox
Copy link

(Hi. Thank you for putting all these interesting articles together.)
I believe there's an issue with the mirroring from the first article, and this issue find its way in the next parts as well.
Although you're setting the scrollTop of the mirrored div to the scrollTop of the textarea on scroll, it's still going out of sync for some reasons once one or more empty new lines are entered at the bottom of the textarea.
Here's a screenshot of the issue:
image
I just typed a few more "you\n\n"s so that the area gets a scrollbar, and then I scrolled up a bit.
I don't know why this is happening yet, but it's obviously not expected.
I've encountered and reproduced this in my own code too, when I was trying your first article (just doing the mirroring). I just used a red color (any color other than transparent works as well) instead of transparent, and it's in sync on scroll, however, as soon as I entered a newline at the last line, it went out of sync.
image
image

@marakas592
Copy link

marakas592 commented Feb 8, 2024

Hello, i have same issue, i don't know how to fix it. I hope you can help! I tried to play with style, but it don't help

123 (2)

@Br3d89
Copy link

Br3d89 commented Mar 26, 2024

Hi, have the same issue, any updates ?

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

No branches or pull requests

3 participants