@leafer-ui/interaction-web 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/interaction-web",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "@leafer-ui/interaction-web",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.0.1",
26
- "@leafer-ui/core": "1.0.1"
25
+ "@leafer/core": "1.0.3",
26
+ "@leafer-ui/core": "1.0.3"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.0.1"
29
+ "@leafer/interface": "1.0.3"
30
30
  }
31
31
  }
@@ -14,7 +14,7 @@ interface IGestureEvent extends IClientPointData, UIEvent {
14
14
  }
15
15
 
16
16
 
17
- const { getMoveEventData, getZoomEventData, getRotateEventData } = InteractionHelper
17
+ const { getMoveEventData, getZoomEventData, getRotateEventData, pathCanDrag } = InteractionHelper
18
18
 
19
19
  export class Interaction extends InteractionBase {
20
20
 
@@ -196,7 +196,10 @@ export class Interaction extends InteractionBase {
196
196
 
197
197
  // touch
198
198
  protected onTouchStart(e: TouchEvent): void {
199
- e.preventDefault()
199
+ const touch = PointerEventHelper.getTouch(e)
200
+ const local = this.getLocal(touch, true)
201
+ const { preventDefault } = this.config.touch
202
+ if (preventDefault === true || (preventDefault === 'auto' && pathCanDrag(this.findPath(local)))) e.preventDefault()
200
203
 
201
204
  this.multiTouchStart(e)
202
205
 
@@ -206,8 +209,7 @@ export class Interaction extends InteractionBase {
206
209
  this.touchTimer = 0
207
210
  }
208
211
  this.useTouch = true
209
- const touch = PointerEventHelper.getTouch(e)
210
- this.pointerDown(PointerEventHelper.convertTouch(e, this.getLocal(touch, true)))
212
+ this.pointerDown(PointerEventHelper.convertTouch(e, local))
211
213
  }
212
214
 
213
215
  protected onTouchMove(e: TouchEvent): void {