bulma-carousel icon indicating copy to clipboard operation
bulma-carousel copied to clipboard

Carousel dont appear when enter in a route

Open alexssandrog opened this issue 6 years ago • 7 comments

Hi, I have different carousels on different routes of my project. When the page is load/reload on the navigator, the carousel is perfectly showed. But when I click on a routerLink for enter a new page with another carousel, the page appear but without the respective carousel.

Anyone use this carousel with routers?

My package on the project "@angular/animations": "7.0.2", "@angular/common": "7.0.2", "@angular/compiler": "7.0.2", "@angular/core": "7.0.2", "@angular/forms": "7.0.2", "@angular/http": "7.0.2", "@angular/platform-browser": "7.0.2", "@angular/platform-browser-dynamic": "7.0.2", "@angular/router": "7.0.2", "animate.css": "^3.7.0", "bulma": "^0.7.2", "bulma-carousel": "^3.0.0", "core-js": "^2.5.7", "rxjs": "^6.3.3", "zone.js": "^0.8.26"

alexssandrog avatar Nov 03 '18 21:11 alexssandrog

Hi, I'm GitMate.io!

It seems you've just enabled the issue triaging. I'm just scraping all issues from your repository and will give you some more information about this in a few minutes or so.

Because of the rate limit we can't scrape all information (including all comments and authors) right now - our system is already set up to scrape this in the next days over which the predictions will become more precise every day.

If you want me to use a different account for triaging your issues, simply create one and log in with it.

Sit tight!

Wikiki avatar Nov 03 '18 21:11 Wikiki

GitMate.io thinks possibly related issues are https://github.com/Wikiki/bulma-carousel/issues/1 (Carousel Slamming), https://github.com/Wikiki/bulma-carousel/issues/3 (carousel scss file), https://github.com/Wikiki/bulma-carousel/issues/38 (Multiple carousel on Angular), https://github.com/Wikiki/bulma-carousel/issues/13 (Carousel not animating with Nuxt), and https://github.com/Wikiki/bulma-carousel/issues/6 (carousel-navigation is-overlay ).

Wikiki avatar Nov 03 '18 21:11 Wikiki

I can confirm that behavior. Same in my app (using angular 6.1.0 with bulma-carousel 3.0.0).

Chris81T avatar Nov 05 '18 19:11 Chris81T

@alexssandrog How do you use the bulma-carousel?

For my app I have created a separate component. Like in the documentation is written, I have called bulmaCarousel.attach(); only one time.

If I will reach a route with the first image-carousel, the attach will be performed and one carousel is listed in the array. If I navigate to another route with a carousel, the attach wont be called again and so no carousel instance exists for the new loaded page and so I wont see the image.

After changing that part in my component, so the attach() will every time be called, if my carousel-component will be created, it works.

But I'm not sure, if there is a problem, when the attach() will be called multi times (for instance one page contains two, three times the carousel-component)

Chris81T avatar Nov 05 '18 19:11 Chris81T

@Chris81T , thanks for your time.

I dont have created a specific component to use with bulmaCarousel, I will try it this way.

Thanks again

alexssandrog avatar Nov 05 '18 19:11 alexssandrog

@alexssandrog You're welcome. But the question is, if it is regardless, if the attach() method is called multi times, if more than one "carousel-component" exists on the same view/page. @Wikiki What do you think? Is this a problem?

Chris81T avatar Nov 05 '18 19:11 Chris81T

It should lead to an issue due to multiple instantiation on same elements. Currently carousel component does not handle multiple instanciation so you will have events attached multiple times.

Wikiki avatar Nov 05 '18 19:11 Wikiki