fix: prevent scroll on desktop
All checks were successful
gitea-sync/antos/pipeline/head This commit looks good

When focusing on a window which overflows the desktop,
the desktop scrolls automatically to bottom,
even when `overflow: hiddle` is set on CSS.

This tricky hack prevents this to happen
This commit is contained in:
DanyLE 2023-01-06 21:34:46 +01:00
parent b66bb3a2c9
commit 89ccbc4b62

View File

@ -61,6 +61,19 @@ namespace OS {
* @memberof DesktopTag
*/
protected mount(): void {
/**
* TRICKY HACK
* When focusing on a window which overflows the desktop,
* the desktop scrolls automatically to bottom,
* even when `overflow: hiddle` is set on CSS.
*
* The following event listener prevents
* the desktop to scroll down in this case
*/
$(this).on("scroll", (e) =>{
if(this.scrollTop != 0)
this.scrollTop = 0;
});
if(this.observer)
{
this.observer.disconnect();