Skip to content

Commit

Permalink
chore: replace at() method (#4628)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubencarvalho authored Jul 30, 2024
1 parent 56366ce commit 8cef2c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/overlay/src/OverlayStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class OverlayStack {
*/
handlePointerdown = (event: Event): void => {
this.pointerdownPath = event.composedPath();
this.lastOverlay = this.stack.at(-1);
this.lastOverlay = this.stack[this.stack.length - 1];
};

/**
Expand Down Expand Up @@ -111,7 +111,7 @@ class OverlayStack {
private handleKeydown = (event: KeyboardEvent): void => {
if (event.code !== 'Escape') return;
if (!this.stack.length) return;
const last = this.stack.at(-1);
const last = this.stack[this.stack.length - 1];
if (last?.type === 'page') {
event.preventDefault();
return;
Expand Down

0 comments on commit 8cef2c6

Please sign in to comment.