bbc / peaks.js

JavaScript UI component for interacting with audio waveforms
https://waveform.prototyping.bbc.co.uk
GNU Lesser General Public License v3.0
3.2k stars 279 forks source link

Zoomview and segments click events getting fired simultaneously #490

Closed vivekd95 closed 1 year ago

vivekd95 commented 1 year ago

Hi @chrisn

In my project, I need both segments.click and zoomview.click. When I click on segments, zoomview.click is also getting fired. I think only segments.click should fire in this case. I have tried in both of the cases: enableSeeking=true & enableSeeking=false Do correct me if I am wrong.

chrisn commented 1 year ago

Yes, you'll get both events. The enableSeek() functions don't affect this. I'll need to think about how to handle this..

chrisn commented 1 year ago

I have added a preventViewEvent() method, so you can do this:

peaks.on('segments.click', function(event) {
  event.preventViewEvent(); // Stops the zoomview.click event from being fired.
});
vivekd95 commented 1 year ago

Hi, @chrisn Thanks. When can we expect the new release?

chrisn commented 1 year ago

I have just released v3.0.0-beta.11. (I hope to get v3.0.0 out at some point soon.)

vivekd95 commented 1 year ago

Thanks, @chrisn for the support.