Skip to content

Commit

Permalink
regions plugin: stop dragging region when mouse exits wavesurfer div (k…
Browse files Browse the repository at this point in the history
…atspaugh#2158)

* stop dragging region when mouse exits wavesurfer div

* update changelog
  • Loading branch information
jbeuckm committed Jan 17, 2021
1 parent e86a8c1 commit d134757
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
wavesurfer.js changelog
=======================

x.x.x (unreleased)
------------------

- Regions plugin: Stop region dragging when mouse leaves canvas (#2158)

4.4.0 (13.01.2021)
------------------

Expand Down
2 changes: 2 additions & 0 deletions src/plugin/regions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ export default class RegionsPlugin {

region = null;
};
this.wrapper.addEventListener('mouseleave', eventUp);
this.wrapper.addEventListener('mouseup', eventUp);
this.wrapper.addEventListener('touchend', eventUp);

Expand All @@ -310,6 +311,7 @@ export default class RegionsPlugin {
document.body.removeEventListener('touchend', eventUp);
this.wrapper.removeEventListener('touchend', eventUp);
this.wrapper.removeEventListener('mouseup', eventUp);
this.wrapper.removeEventListener('mouseleave', eventUp);
});

const eventMove = e => {
Expand Down

0 comments on commit d134757

Please sign in to comment.