Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit 2857801

Browse files
author
Matt Moran
committed
fix(home): fixed bug where carousel did not start
fixed bug where carousel wouldn't start on load by forcing bootstrap to reinitialize the component
1 parent 8331c9d commit 2857801

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pages/app-home/app-home.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ export class AppHome {
5959

6060
/* tslint:disable-next-line */
6161
$(document).ready(function() {
62-
$('[data-slide-to=0]').trigger('click');
62+
// Force bootstrap to initialize carousel
63+
const processCarousel = $('#processCarousel');
64+
setTimeout(() => window['bootstrap'].Carousel._jQueryInterface.call(processCarousel, processCarousel.data()), 0);
65+
6366
$(window).trigger('scroll'); // init the value
6467
});
6568
}
@@ -104,7 +107,7 @@ export class AppHome {
104107
</h2>
105108
</div>
106109

107-
<div id="processCarousel" class="carousel slide" data-ride="carousel">
110+
<div id="processCarousel" class="carousel slide" data-ride="carousel" data-pause="false">
108111
<app-carousel-indicators class="carousel-main-indicators" activeIndex="0" />
109112
<div class="carousel-inner">
110113
<div class="carousel-item active">

0 commit comments

Comments
 (0)