We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 710ea2b commit e5264f1Copy full SHA for e5264f1
assets/hb/modules/slide/js/index.ts
@@ -13,20 +13,16 @@
13
const step = inner.offsetWidth
14
let left = 0
15
if (dir === 'left') {
16
- left = inner.scrollLeft - step
+ left = Math.max(inner.scrollLeft - step, 0 - inner.scrollLeft)
17
} else {
18
left = Math.min(inner.scrollWidth - inner.clientWidth, inner.scrollLeft + step)
19
}
20
- if (left <= 0) {
21
- scrolling = false
22
- return
23
- }
24
25
inner.scroll({
26
left
27
})
28
const checker = setInterval(() => {
29
- if (left === inner.scrollLeft) {
+ if (left === inner.scrollLeft || inner.scrollLeft === 0) {
30
scrolling = false
31
clearInterval(checker)
32
0 commit comments