LuaLS / LuaLS.github.io

Statically generated website for LuaLS using Astro.
https://luals.github.io/
6 stars 12 forks source link

Annotation outline behavior is broken #26

Closed Fireboyd78 closed 7 months ago

Fireboyd78 commented 8 months ago

Below should be self-explanatory what's happening. You try to click on something and it doesn't scroll correctly.

chrome_G2a7Mx0zT6

This is rather quite frustrating, because trying to refer to the documentation is basically made impossible with this unfriendly behavior.

Browser: Chrome Version 122.0.6261.70 (Official Build) (64-bit)

Fireboyd78 commented 8 months ago

This issue was caused by commit 3bd0c0d, you can see here the block of code that is responsible for this.

carsakiller commented 7 months ago

Interesting… I knew chrome by default has smooth scrolling disabled, and it must be manually enabled using an experimental flag, but it looks like with smooth scrolling disabled, this problem does not occur. It is only if I enable experimental smooth scrolling that I experience this issue.

We may have to find a way to disable smooth scrolling in chrome, or just disable it all together. Both are not ideal.

carsakiller commented 7 months ago

I am running chrome in Windows Sandbox and when the sandbox is in windowed mode, I experience this issue, but when I fullscreen it, it works as expected. Very weird...

carsakiller commented 7 months ago

Now I have installed Chrome locally and cannot reproduce at all.

Fireboyd78 commented 7 months ago

@carsakiller Can you verify that removing the code I linked to still results in the expected behavior?

carsakiller commented 7 months ago

Chrome seems to be unable to scroll in two containers at once. When the article is scrolled down, the sidebar scrolls to match, which Chrome seems to take issue with.

I wanted to listen to the scrollend event and just scroll the sidebar when the main content scrolling is finished, but unfortunately, Safari/WebKit does not support it. I have instead opted to just listen for debounced scroll events and scroll the sidebar when that is finished. Let me know if this works for you 🙂

Fireboyd78 commented 7 months ago

Wow! I'm very impressed this was resolved so quickly. Yes, it works great now! If you wanna go the extra step, see if you could get it to auto-scroll when you have a link id (e.g. #generic) at the end of the URL.

Otherwise, I feel it's all good now 👍 Thank you for addressing this in such a timely manner, it's greatly appreciated 😁

carsakiller commented 7 months ago

@Fireboyd78 no problem!

I didn't know the scrolling to IDs was also broken in chrome 😟. Turns out that the basic lazy-loading of images I had in articles caused the scrolling to break. I know the long-term solution, but for now I have just removed lazy loading and forced browsers to scroll to the targeted ID on page load.

Let me know if there are any other issues, you've been very helpful!