Skip to content

Commit

Permalink
Merge pull request #2556 from exadel-inc/fix/esl-carousel-grid
Browse files Browse the repository at this point in the history
fix(esl-carousel): fix carousel empty state
  • Loading branch information
abarmina committed Jul 31, 2024
2 parents 420056d + 8f88589 commit 38b3bc7
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 38b3bc7

Please sign in to comment.