Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure compatability between TimelinePlugin and RegionsPlugin #3363

Merged

Conversation

alexgdiaz98
Copy link
Contributor

A few sensible changes to ensure safe interaction between the TimelinePlugin and RegionsPlugin in the DOM.

Short description

Resolves #3293

Implementation details

TimelinePlugin wrapper element has pointer-events: none; to ensure mouse interaction with other elements above or below the timeline. The RegionsPlugin targets the canvases div in this.wavesurfer.getWrapper() as the draggable target to avoid unexpectedly targeting an incorrect div.

How to test it

const wavesurfer = WaveSurfer.create({
  container: '#wavesurfer-container',
})
const timeline = TimelinePlugin.create({
  container: wavesurfer.getWrapper(),
  insertPosition: 'beforebegin'
})
wavesurfer.registerPlugin(timeline)
const regions = RegionsPlugin.create()
wavesurfer.registerPlugin(regions)
regions.enableDragSelection()

Dragging anywhere on the canvas, including over the timeline, should create a region.

Screenshots

Checklist

  • This PR is covered by e2e tests
  • It introduces no breaking API changes

src/plugins/timeline.ts Outdated Show resolved Hide resolved
src/plugins/regions.ts Outdated Show resolved Hide resolved
Copy link
Owner

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@katspaugh katspaugh merged commit b95a111 into katspaugh:main Dec 2, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't add new regions by drag selection when timeline plugin is created with insertPosition 'beforebegin'
2 participants