Skip to content

Commit

Permalink
fix(esl-carousel): fix carousel empty state
Browse files Browse the repository at this point in the history
Co-authored-by: ala'n (Alexey Stsefanovich) <astsefanovich@exadel.com>
  • Loading branch information
abarmina and ala-n committed Jul 31, 2024
1 parent 420056d commit 8f88589
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/esl-carousel/core/esl-carousel.less
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ esl-carousel {
user-select: none;
pointer-events: none;
}

&[empty] {
--esl-carousel-side-space: 0;

[esl-carousel-slides] {
display: none;
}
}
}

/* Default carousel area styles */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class ESLGridCarouselRenderer extends ESLDefaultCarouselRenderer {

/** Count of fake slides to fill the last "row" or incomplete carousel state */
public get fakeSlidesCount(): number {
if (this.$carousel.$slides.length === 0) return 0;
if (this.$carousel.$slides.length < this.count) {
return this.count - this.$carousel.$slides.length;
}
Expand Down

0 comments on commit 8f88589

Please sign in to comment.