Skip to content

Commit

Permalink
add stop drag event to ScrollBar
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecarenzo committed Aug 29, 2023
1 parent 343bdd8 commit 8b566cb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/attack_flow_builder/src/components/Containers/ScrollBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export default defineComponent({
*/
startDrag(event: PointerEvent) {
this.handle.trk.capture(event, this.onDrag);
// Configure stop drag
document.addEventListener("pointerup", this.stopDrag, { once: true });
},
/**
Expand All @@ -132,6 +134,16 @@ export default defineComponent({
);
},
/**
* Scroll handle drag stop behavior.
* @param event
* The pointer event.
*/
stopDrag(event: PointerEvent) {
// Release pointer
this.handle.trk.release(event);
},
/**
* Scroll content behavior.
*/
Expand Down

0 comments on commit 8b566cb

Please sign in to comment.