@varlet/touch-emulator 1.26.4 → 1.26.5

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.
Files changed (3) hide show
  1. package/iife.js +2 -2
  2. package/index.js +2 -2
  3. package/package.json +1 -1
package/iife.js CHANGED
@@ -51,8 +51,8 @@
51
51
 
52
52
  function triggerTouch(touchType, mouseEvent) {
53
53
  const { altKey, ctrlKey, metaKey, shiftKey } = mouseEvent
54
- const touchEvent = document.createEvent('Event')
55
- touchEvent.initEvent(touchType, true, true)
54
+ const touchEvent = new Event(touchType, {bubbles:true, cancelable:true})
55
+
56
56
 
57
57
  touchEvent.altKey = altKey
58
58
  touchEvent.ctrlKey = ctrlKey
package/index.js CHANGED
@@ -50,8 +50,8 @@ function getActiveTouches(mouseEvent) {
50
50
 
51
51
  function triggerTouch(touchType, mouseEvent) {
52
52
  const { altKey, ctrlKey, metaKey, shiftKey } = mouseEvent
53
- const touchEvent = document.createEvent('Event')
54
- touchEvent.initEvent(touchType, true, true)
53
+ const touchEvent = new Event(touchType, {bubbles:true, cancelable:true})
54
+
55
55
 
56
56
  touchEvent.altKey = altKey
57
57
  touchEvent.ctrlKey = ctrlKey
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/touch-emulator",
3
- "version": "1.26.4",
3
+ "version": "1.26.5",
4
4
  "description": "touch-emulator",
5
5
  "keywords": [
6
6
  "emulator",