mspae / react-wavesurfer

React component wrapper for wavesurfer.js
BSD 3-Clause "New" or "Revised" License
108 stars 46 forks source link

Regions not responsive, not re-rendering on zoom #87

Open rockyhuber opened 6 years ago

rockyhuber commented 6 years ago

When zooming or contracting the screen size, waveform remains responsive, however regions to not update to match the responsive waveform. Any suggestions on how to fix this?

rockyhuber commented 6 years ago

That was a quick fix, for anyone interested, I went to the wavesurfer.regions.js file (wavesurfer.js) and added this line of code to the bottom of the init: function...

window.addEventListener('resize', this.onZoom);

Will re-render the regions as you resize the browser.