feat(ux): improve pull-down interaction for mobile modal (#440)

* Adjusts overlay background opacity dynamically based on drag position
* Ensures smooth transition as the modal is pulled down
* Enhances UX for mobile users by making dismissal more intuitive
This commit is contained in:
Huang Xin
2025-02-24 01:05:13 +01:00
committed by GitHub
parent 9e7e41a623
commit ccc04825b7
16 changed files with 236 additions and 58 deletions
@@ -25,7 +25,7 @@ export const usePullToRefresh = (ref: React.RefObject<HTMLDivElement>, onTrigger
const initialX = startEvent.touches[0]!.clientX;
const initialY = startEvent.touches[0]!.clientY;
el.addEventListener('touchmove', handleTouchMove, { passive: false });
el.addEventListener('touchmove', handleTouchMove, { passive: true });
el.addEventListener('touchend', handleTouchEnd);
function handleTouchMove(moveEvent: TouchEvent) {