posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.82k stars 90 forks source link

Fix console scrolling for web #5439

Open timtmok opened 12 hours ago

timtmok commented 12 hours ago

Address #2056

VS Code drops the wheel scroll event to prevent gesture navigation. This listens to the event on the top level element in the console and forwards the scroll to the parent container.

The fix also didn't seem to affect desktop but it seems safer to add an isWeb check.

I suspect there may be other places that have this problem too. Going forward, it might be better to try to use the Scrollable component that uses VS Code's scrollable code and that would hopefully avoid this bug. However, Scrollable needs to know the container dimensions and the content dimensions to properly size the scroll bar.

QA Notes

I tested locally with a trackpad but the event should also be triggered for a standard mouse wheel to fix the scrolling.