@whitesev/domutils 1.8.1 → 1.8.2

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/dist/index.amd.js CHANGED
@@ -517,7 +517,7 @@ define((function () { 'use strict';
517
517
  },
518
518
  };
519
519
 
520
- const version = "1.8.1";
520
+ const version = "1.8.2";
521
521
 
522
522
  class ElementSelector {
523
523
  windowApi;
@@ -2611,6 +2611,8 @@ define((function () { 'use strict';
2611
2611
  let timer = void 0;
2612
2612
  /** 是否是移动端点击 */
2613
2613
  let isMobileTouch = false;
2614
+ /** 检测是否是单击的延迟时间 */
2615
+ const checkClickTime = 200;
2614
2616
  const dblclick_handler = async (evt, option) => {
2615
2617
  if (evt.type === "dblclick" && isMobileTouch) {
2616
2618
  // 禁止在移动端触发dblclick事件
@@ -2623,8 +2625,10 @@ define((function () { 'use strict';
2623
2625
  isDoubleClick: true,
2624
2626
  });
2625
2627
  }, options);
2626
- const touchEndListener = this.on($el, "touchend", selector, (evt, selectorTarget) => {
2627
- isMobileTouch = true;
2628
+ const touchEndListener = this.on($el, "pointerup", selector, (evt, selectorTarget) => {
2629
+ if (evt.pointerType === "touch") {
2630
+ isMobileTouch = true;
2631
+ }
2628
2632
  CommonUtils.clearTimeout(timer);
2629
2633
  timer = void 0;
2630
2634
  if (isDoubleClick && $click === selectorTarget) {
@@ -2642,7 +2646,7 @@ define((function () { 'use strict';
2642
2646
  dblclick_handler(evt, {
2643
2647
  isDoubleClick: false,
2644
2648
  });
2645
- }, 200);
2649
+ }, checkClickTime);
2646
2650
  isDoubleClick = true;
2647
2651
  $click = selectorTarget;
2648
2652
  }