Skip to content

Commit 44fd55e

Browse files
authored
fix(regions): avoid listeners after removal (#4165)
1 parent 898fbd7 commit 44fd55e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugins/regions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ class RegionsPlugin extends BasePlugin<RegionsPluginEvents, RegionsPluginOptions
589589
}
590590

591591
setTimeout(() => {
592-
if (!this.wavesurfer) return
592+
if (!this.wavesurfer || !region.element) return
593593
renderIfVisible()
594594

595595
const unsubscribeScroll = this.wavesurfer.on('scroll', renderIfVisible)

0 commit comments

Comments
 (0)