kueblc / LDT

Lightweight in browser syntax highlighting
https://kueblc.github.io/LDT/
159 stars 17 forks source link

Fixing caret issue #21

Closed tdaron closed 2 years ago

tdaron commented 2 years ago

There was a problem with the caret (Tested in firefox dev edition)

Cause of the textarea transparent text color, when I was clicking at an other place of the textarea, the caret needed some time to be moved, it has to disappear from it's old location and next it was going to appear at the good location.

If we put the textarea color in white, with very very low opacity, it works pretty well and we can't see the difference !

tdaron commented 2 years ago

It works better with opacity at 0.002 instead of 0.02

Yaffle commented 2 years ago

I see this in Firefox 94. Looks like a bug in Firefox. I think, some comment can be helpful in CSS.

kueblc commented 2 years ago

Thanks for your contribution @Kaporos!

I will test this out soon.

kueblc commented 2 years ago

I can indeed reproduce this with the current Firefox. Thanks for the fix!

Let's add a comment so we don't forget what this workaround is for.

kueblc commented 2 years ago

I did a bit more digging on this and found that resize: none is a likely culprit.

Without it, Firefox repaints the caret immediately as expected, even with color: transparent. With resize: none, we see the delayed repainted issue.

I haven't been able to find a relevant ticket on Mozilla's bug tracker.