File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ declare module "panzoom" {
22
22
onDoubleClick ?: ( e : Event ) => void ;
23
23
smoothScroll ?: boolean ;
24
24
controller ?: SVGElement | HTMLElement ;
25
+ enableTextSelection ?: boolean ;
25
26
}
26
27
27
28
export interface PanZoom {
Original file line number Diff line number Diff line change @@ -661,9 +661,10 @@ function createPanZoom(domElement, options) {
661
661
// window, and we will loose it
662
662
document . addEventListener ( 'mousemove' , onMouseMove )
663
663
document . addEventListener ( 'mouseup' , onMouseUp )
664
-
665
- preventTextSelection . capture ( e . target || e . srcElement )
666
-
664
+
665
+ if ( ! options . enableTextSelection ) {
666
+ preventTextSelection . capture ( e . target || e . srcElement )
667
+ }
667
668
return false
668
669
}
669
670
@@ -685,7 +686,9 @@ function createPanZoom(domElement, options) {
685
686
}
686
687
687
688
function onMouseUp ( ) {
688
- preventTextSelection . release ( )
689
+ if ( ! options . enableTextSelection ) {
690
+ preventTextSelection . release ( )
691
+ }
689
692
triggerPanEnd ( )
690
693
releaseDocumentMouse ( )
691
694
}
You can’t perform that action at this time.
0 commit comments