wavesurfer-react icon indicating copy to clipboard operation
wavesurfer-react copied to clipboard

fix: Add height=100% to container if height is set to auto

Open clinton-encord opened this issue 5 months ago • 2 comments

When passing height='auto' to the WavesurferPlayer, it is not actually able to take automatically adjust height because the container defined in WavesurferPlayer doesn't have a height.

So realistically, someone who uses WavesurferPlayer would expect the player to take the height of its player container.

i.e.

<div style={{height: "500px"}}> //  I expect Wavesufer to take the height of this div
    <WavesurferPlayer height='auto'/>
</div>

clinton-encord avatar Jul 30 '25 14:07 clinton-encord

Hi @katspaugh ! Could you run the workflows here?

clinton-encord avatar Aug 11 '25 08:08 clinton-encord

@clinton-encord sorry for the late reply! I read the PR I'm not sure auto and 100% should be synonymous. According to MDN, auto means "The browser will calculate and select a height for the specified element."

I understand that the main issue that the outer container div that the React wrapper creates doesn't automatically inherit the height of its parent. So perhaps we should just always set its height to 100%?

katspaugh avatar Aug 11 '25 10:08 katspaugh