Closed rowild closed 2 years ago
Do you only want to disable the click to change playhead, or also disable click+drag to scroll the view?
Also click&drag should be disabled. (The user should not be allowed to interact at all with the waveform)
Can you explain more about assigning CSS classes, I'm not sure I fully understand your question?
All I do is wrap a div around each view and add a respective css class:
<div class="[ zoomview-wrapper ]">
<div id="zoomview" class="pointer-events-none"></div>
</div>
pointer-events-none
is a tailwindcss class:
.pointer-events-none {
pointer-events: none;
}
With JS I simply check the classList of a div:
// Either the waveform container directly:
const zoomview = document.getElementById('zoomview')
// or the wrapper element
const zoomview = document.querySelector('.zoomview-wrapper')
zoomview.classList.toggle('pointer-events-none')
I saw you added functions. Haven't checked them yet, but - THANK YOU!
I just merged PR #424, happy to take any feedback. Maybe we don't need those functions, as setting the pointer-events
in CSS also works!?
I'll close this, given your feedback on #424. Thanks @rowild!
Clicking into a waveform moves the playhead to the click position. Is there a way to suppress this functionality?
Background: The app consists of 2 steps:
Thank you!
UPDATE: I should add that it must still be possible to set markers via key strokes. Also, I currently assign a css class to the waveform container with "pointer-event: null". That works fine. However, I would love to know if there is a JS- or peaks-way. :-)