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

Fix Flickering issue #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

omelsoft
Copy link

Flickering Issue when moving up and down a scrollable document while the sidebar is open

See: SidebarJS/angular-sidebarjs#7

This is generated when updating the sidebarjs.scss file and compile the CSS.

Added the following in the --is-moving class:

[sidebarjs-container] {
transform: none!important;
}

in the following.

[sidebarjs] {
@extend %component--full-screen;
position: fixed;
z-index: 9999;
transition: transform 0s $timing $duration;
&.sidebarjs--is-visible {
@include component--is-visible;
}
&.sidebarjs--is-moving {
transition: none;
transform: translate(0, 0);
[sidebarjs-container] {
transform: none!important;
}

[sidebarjs-container],
[sidebarjs-backdrop] {
transition: none;
}
}
}
The issue is that every time the user moves up and down the transform property always gets updated. That's the reason for the flickering issue. To fix that, I added an override to force the transform to none.

Flickering Issue when moving up and down a scrollable document while the sidebar is open

See: SidebarJS/angular-sidebarjs#7


This is generated when updating the sidebarjs.scss file and compile the CSS.

Added the following in the --is-moving class:

[sidebarjs-container] {
            transform: none!important;
        }

in the following.

[sidebarjs] {
    @extend %component--full-screen;
    position: fixed;
    z-index: 9999;
    transition: transform 0s $timing $duration;
    &.sidebarjs--is-visible {
        @include component--is-visible;
    }
    &.sidebarjs--is-moving {
        transition: none;
        transform: translate(0, 0);
        **[sidebarjs-container] {
            transform: none!important;
        }**
        [sidebarjs-container],
        [sidebarjs-backdrop] {
            transition: none;
        }
    }
}
The issue is that every time the user moves up and down the transform property always gets updated. That's the reason for the flickering issue. To fix that, I added an override to force the transform to none.
@samoel02
Copy link

samoel02 commented Apr 23, 2022

Hi,I have tryied your css fix, it did fixed the moving sidebar but it looses the transition if you are done scrolling and tryied to open or close the sidebar.
the ideal solution is creating a small function to detect scrolling event and add a class like (.sidebarjs--is-scrolling).
This is a bug need to be fix in the core plugin

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

Successfully merging this pull request may close these issues.

2 participants