wavesurfer.js icon indicating copy to clipboard operation
wavesurfer.js copied to clipboard

Add new setScroll method

Open ffxsam opened this issue 6 months ago • 2 comments

Per https://github.com/katspaugh/wavesurfer.js/discussions/3405, it would be great to have a setScroll method (counterpart to getScroll), to be able to programmatically set the scroll position.

I'll likely work on this. Feel free to mark this issue as an enhancement.

ffxsam avatar Dec 13 '23 17:12 ffxsam

I need this too. What about having setScroll forward the command to the private scrollIntoView method in renderer.ts?

tapeboy7 avatar Dec 18 '23 14:12 tapeboy7

scrollIntoView won't set the scroll to an arbitrary point, it only makes sure the playhead is visible.

It should be a new renderer method that simply sets this.scrollContainer.scrollLeft.

katspaugh avatar Dec 18 '23 14:12 katspaugh