Skip to content

Commit b95a111

Browse files
alexgdiaz98Alexander Diaz
andauthored
Ensure compatability between TimelinePlugin and RegionsPlugin (#3363)
* Remove pointer events from TimelinePlugin wrapper. Use canvases div as RegionsPlugin draggable target. * Revert wrapper to private * Revert addition of part attribute --------- Co-authored-by: Alexander Diaz <[email protected]>
1 parent 1a15a02 commit b95a111

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/plugins/regions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,8 @@ class RegionsPlugin extends BasePlugin<RegionsPluginEvents, RegionsPluginOptions
509509
* Returns a function to disable the drag selection.
510510
*/
511511
public enableDragSelection(options: Omit<RegionParams, 'start' | 'end'>): () => void {
512-
const wrapper = this.wavesurfer?.getWrapper()?.querySelector('div')
513-
if (!wrapper) return () => undefined
512+
const wrapper = this.wavesurfer?.getWrapper()?.querySelector('div.canvases')
513+
if (!wrapper || !(wrapper instanceof HTMLElement)) return () => undefined
514514

515515
const initialSize = 5
516516
let region: Region | null = null

src/plugins/timeline.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ class TimelinePlugin extends BasePlugin<TimelinePluginEvents, TimelinePluginOpti
103103
private initTimelineWrapper(): HTMLElement {
104104
const div = document.createElement('div')
105105
div.setAttribute('part', 'timeline')
106+
div.setAttribute('style', 'pointer-events: none;')
106107
return div
107108
}
108109

0 commit comments

Comments
 (0)