Skip to content

Commit a3ada2f

Browse files
committed
fix: 🐞 fix bug
1 parent 526263e commit a3ada2f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,18 +524,18 @@ export function generateTrigger(
524524
}
525525

526526
// ======================= Action: PointDown ========================
527-
const pointDownToShow = showActions.has('pointDown');
528-
const pointDownToHide = hideActions.has('pointDown');
527+
const pointDownToShow = showActions.has('pointerDown');
528+
const pointDownToHide = hideActions.has('pointerDown');
529529
if (pointDownToShow || pointDownToHide) {
530-
cloneProps.onPointDown = (event: React.PointerEvent<HTMLElement>, ...args: any[]) => {
530+
cloneProps.onPointerDown = (event: React.PointerEvent<HTMLElement>, ...args: any[]) => {
531531
if (openRef.current && pointDownToHide) {
532532
triggerOpen(false); // to hide
533533
} else if (!openRef.current && pointDownToShow) {
534534
setMousePosByEvent(event);
535535
triggerOpen(true);
536536
}
537537
// origin methods
538-
originChildProps.onPointDown?.(event, ...args);
538+
originChildProps.onPointerDown?.(event, ...args);
539539
}
540540
}
541541
// ======================= Action: Click ========================
@@ -556,7 +556,7 @@ export function generateTrigger(
556556
};
557557
}
558558

559-
// Click/PointDown to hide is special action since click popup element should not hide
559+
// Click/PointerDown to hide is special action since click popup element should not hide
560560
useWinClick(
561561
mergedOpen,
562562
clickToHide,

src/interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export type BuildInPlacements = Record<string, AlignType>;
104104

105105
export type StretchType = string;
106106

107-
export type ActionType = 'hover' | 'focus' | 'click' | 'contextMenu' | 'pointDown';
107+
export type ActionType = 'hover' | 'focus' | 'click' | 'contextMenu' | 'pointerDown';
108108

109109
export type AnimationType = string;
110110

0 commit comments

Comments
 (0)