Skip to content

Commit

Permalink
fix(context-menu): add context.setAnchorRect call on pointer down (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
simbas authored Feb 9, 2024
1 parent 457bbf0 commit c1a74f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Kobalte follows the [conventional commits](https://www.conventionalcommits.org/e
- Build local version of all packages – `pnpm build:libs`.
- Build local version of specific packages – `pnpm -F <package-name> build`.
- To start docs – `pnpm dev:docs`.
- To start playground – `pnpm dev:playground`.
- To start playground – `pnpm dev:core`.

### Tests

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/context-menu/context-menu-trigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export function ContextMenuTrigger(props: ContextMenuTriggerProps) {
if (!local.disabled && isTouchOrPen(e)) {
// Clear the long press here in case there's multiple touch points.
clearLongPressTimeout();
context.setAnchorRect({ x: e.clientX, y: e.clientY });
longPressTimoutId = window.setTimeout(() => menuContext.open(false), 700);
}
};
Expand Down

0 comments on commit c1a74f1

Please sign in to comment.