Skip to content

Commit 0202a19

Browse files
fix(module:carousel): carousel not working correctly in rtl mode (#8770)
1 parent eb1fdc5 commit 0202a19

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

components/carousel/carousel.component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'carousel';
6464
<div
6565
class="slick-initialized slick-slider"
6666
[class.slick-vertical]="nzDotPosition === 'left' || nzDotPosition === 'right'"
67+
[dir]="'ltr'"
6768
>
6869
<div
6970
#slickList

components/carousel/carousel.spec.ts

+6
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ describe('carousel', () => {
266266
tick(1000 + 10);
267267
expect(carouselContents[3].nativeElement.classList).toContain('slick-active');
268268
}));
269+
270+
it('should call goTo function on slick dot click', () => {
271+
spyOn(testComponent.nzCarouselComponent, 'goTo');
272+
carouselWrapper.nativeElement.querySelector('.slick-dots').lastElementChild.click();
273+
expect(testComponent.nzCarouselComponent.goTo).toHaveBeenCalledWith(3);
274+
});
269275
});
270276

271277
describe('strategies', () => {

components/carousel/style/patch.less

-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,3 @@ nz-carousel {
1313
.slick-track {
1414
opacity: 1;
1515
}
16-
17-
.slick-list {
18-
direction: ltr;
19-
}

0 commit comments

Comments
 (0)