Skip to content

Commit d702a42

Browse files
authored
fix: new slider styles (#979)
* fix: slider new keep autoplay after interaction * fix: slider new safari fix * fix: slider new dots classname
1 parent 3068e0f commit d702a42

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

src/blocks/SliderNew/Slider.scss

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ $block: '.#{$ns}SliderNewBlock';
1414
}
1515
}
1616

17+
$dotsCn: '.swiper-container-horizontal .swiper-pagination-bullets';
18+
1719
$dotSize: 8px;
1820

1921
#{$block} {
@@ -33,10 +35,24 @@ $dotSize: 8px;
3335
}
3436
}
3537

36-
&__slide {
38+
&__slide.swiper-slide {
3739
padding: 0 #{$gridGutter};
3840
box-sizing: border-box;
39-
flex-shrink: 0;
41+
height: auto;
42+
43+
@keyframes safari-fix {
44+
from {
45+
transform: translateX(0.001px);
46+
}
47+
to {
48+
transform: translateX(0);
49+
}
50+
}
51+
52+
// fix text under video in safari
53+
&.swiper-slide-visible {
54+
animation: safari-fix 300ms;
55+
}
4056
}
4157

4258
&__arrow {
@@ -121,7 +137,7 @@ $dotSize: 8px;
121137

122138
padding: 0;
123139

124-
#{$root}__dots {
140+
& #{$dotsCn} {
125141
bottom: $indentSM;
126142
}
127143

@@ -167,7 +183,7 @@ $dotSize: 8px;
167183
position: relative;
168184
}
169185

170-
#{$root}__dots {
186+
& #{$dotsCn} {
171187
bottom: $indentM;
172188
}
173189

src/blocks/SliderNew/useSlider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const useSlider = ({
7878
setIsLocked,
7979
autoplay: autoplayEnabled && {
8080
delay: autoplayMs,
81+
disableOnInteraction: false,
8182
},
8283
};
8384
};

0 commit comments

Comments
 (0)