-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Hi,
There an issue when I click on button previous I go previous twice and not only one time.
I've check the code and the issue is here :
prev(): void {
this.$emit('prev')
const container = this.$refs.container as Element
const left = container.getBoundingClientRect().left
const x = left + (container.clientWidth * -this.displacement) - delta
const element = this.findPrevSlot(x)
if (element) {
const width = element.getBoundingClientRect().left - left
this.scrollToLeft(container.scrollLeft + width)
return
}
const width = container.clientWidth * this.displacement
this.scrollToLeft(container.scrollLeft - width)
},
You have to change
if (element) {
const width = element.getBoundingClientRect().left - left
this.scrollToLeft(container.scrollLeft + width)
return
}
by
if (element) {
const width = element.getBoundingClientRect().left - left
if (width > delta) {
this.scrollToLeft(container.scrollLeft + width)
return
}
}
Best regards
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels