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

[BUG] SfGallery glitching when redirecting from a page #2190

Closed
DavidGolodetsky opened this issue Jan 4, 2022 · 6 comments
Closed

[BUG] SfGallery glitching when redirecting from a page #2190

DavidGolodetsky opened this issue Jan 4, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@DavidGolodetsky
Copy link
Contributor

Describe the bug
When I use the SfGalley component on a page and then redirect away from (inner routes) gallery is glitching for a split of a second and shows me a row of images that I have in it.

Additional context
I checked the code of the SfGallery component and it seems like it's caused by this part:

  beforeDestroy() {
    if (this.glide) {
      this.glide.destroy();
    }
  }

I wonder if we need it in the first place? Is there an actual memory leak without destroying glide instance?

@DavidGolodetsky DavidGolodetsky added the bug Something isn't working label Jan 4, 2022
@DavidGolodetsky
Copy link
Contributor Author

DavidGolodetsky commented Jan 4, 2022

Adding setTimeout fixes the problem, what do you think of this fix?

beforeDestroy() {
    if (this.glide) {
      setTimeout(() => this.glide.destroy(), 0);
    }
  }

yet the question remains - do we need to destroy Glide instance at all?

@AdamPawlinski AdamPawlinski self-assigned this Feb 2, 2022
@AdamPawlinski
Copy link
Contributor

@DavidGolodetsky Hi, could you please help me reproduce this behavior? I checked it in a few implementations without result. Maybe it is a question of the version of SFUI, you use.

@DavidGolodetsky
Copy link
Contributor Author

I'm using version ^0.11.0. From the code, it looks like nothing have changed there in this regard in v 12. I'll try to prepare a codepen for it

@DavidGolodetsky
Copy link
Contributor Author

Also, it seems to be related to this issue about Glide.js. Overall my impression is that the lib is unreliable and the project looks abandoned. Is there any chance to review this dependency?

@DavidGolodetsky
Copy link
Contributor Author

Couldn't reproduce either, maybe it's something on our side. I guess we can close it in such case

@AdamPawlinski
Copy link
Contributor

Ok, thanks for checking. If it happens again, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants