Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/@react-aria/interactions/src/usePress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ interface EventBase {
altKey: boolean,
clientX?: number,
clientY?: number,
targetTouches?: Array<{clientX?: number, clientY?: number}>
targetTouches?: Array<{clientX?: number, clientY?: number}>,
key?: string
}

export interface PressResult {
Expand Down Expand Up @@ -117,6 +118,7 @@ class PressEvent implements IPressEvent {
altKey: boolean;
x: number;
y: number;
key: string | undefined;
#shouldStopPropagation = true;

constructor(type: IPressEvent['type'], pointerType: PointerType, originalEvent: EventBase, state?: PressState) {
Expand Down Expand Up @@ -146,6 +148,7 @@ class PressEvent implements IPressEvent {
this.altKey = originalEvent.altKey;
this.x = x;
this.y = y;
this.key = originalEvent.key;
}

continuePropagation() {
Expand Down Expand Up @@ -983,7 +986,8 @@ function createEvent(target: FocusableElement, e: EventBase): EventBase {
metaKey: e.metaKey,
altKey: e.altKey,
clientX,
clientY
clientY,
key: e.key
};
}

Expand Down
Loading
Loading