ilyashubin/scrollbooster

setPosition doesn’t smoothly scroll

Closed this issue · 2 comments

Is there a way to make setPosition smoothly scroll?

scroll() {
	this.scrollBooster.setPosition({
		x: this.scrollBooster.getUpdate().position.x += 200
	});
}

This is attached to a button that will scroll the content. I tried to maually set the translate:

scroll() {
	contentElement.style.transform = `translateX(${-data.position.x}px)`
}

But this gets overidden instantly and set back to the current position stored with ScollBooster.

How to solve this problem?

Hello! There is now method scrollTo in version 2 of the library for smooth scrolling to coordinate