@cloudparse/up-miniapps-sdk 0.5.4 → 0.5.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.
package/dist/index.cjs CHANGED
@@ -410,6 +410,7 @@ var resolveHeightToPixels = (height, containerHeight) => {
410
410
  };
411
411
  var CONTENT_EDGE_PULL_THRESHOLD_PX = 24;
412
412
  var HANDLE_BAR_HEIGHT_PX = 32;
413
+ var HANDLE_TAP_CLICK_SUPPRESSION_MS = 400;
413
414
  var MapDrawer = (0, import_react2.forwardRef)(
414
415
  ({
415
416
  menuItems,
@@ -674,7 +675,7 @@ var MapDrawer = (0, import_react2.forwardRef)(
674
675
  suppressNextClickRef.current = true;
675
676
  setTimeout(() => {
676
677
  suppressNextClickRef.current = false;
677
- }, 500);
678
+ }, HANDLE_TAP_CLICK_SUPPRESSION_MS);
678
679
  }
679
680
  setTouchStartY(null);
680
681
  setCurrentTouchY(null);
@@ -738,6 +739,12 @@ var MapDrawer = (0, import_react2.forwardRef)(
738
739
  }
739
740
  });
740
741
  };
742
+ const handleNativeClickCapture = (e) => {
743
+ if (!suppressNextClickRef.current) return;
744
+ suppressNextClickRef.current = false;
745
+ e.preventDefault();
746
+ e.stopPropagation();
747
+ };
741
748
  container.addEventListener("touchstart", handleNativeTouchStart, {
742
749
  passive: true
743
750
  });
@@ -747,10 +754,16 @@ var MapDrawer = (0, import_react2.forwardRef)(
747
754
  container.addEventListener("touchend", handleNativeTouchEnd, {
748
755
  passive: true
749
756
  });
757
+ container.addEventListener("click", handleNativeClickCapture, {
758
+ capture: true
759
+ });
750
760
  return () => {
751
761
  container.removeEventListener("touchstart", handleNativeTouchStart);
752
762
  container.removeEventListener("touchmove", handleNativeTouchMove);
753
763
  container.removeEventListener("touchend", handleNativeTouchEnd);
764
+ container.removeEventListener("click", handleNativeClickCapture, {
765
+ capture: true
766
+ });
754
767
  };
755
768
  }, [
756
769
  side,
@@ -3499,7 +3512,7 @@ var RoutingService = {
3499
3512
  };
3500
3513
 
3501
3514
  // package.json
3502
- var version = "0.5.4";
3515
+ var version = "0.5.5";
3503
3516
 
3504
3517
  // src/sdk.ts
3505
3518
  function deepFreeze(obj) {