Skip to content

Commit

Permalink
fix(overlay-root): open/close with the same scheduling consideration
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed Oct 7, 2019
1 parent 3e6d731 commit 919b64e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/overlay-root/src/overlay-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ export class OverlayStack {
}

public closeOverlay(event: CustomEvent<OverlayCloseDetail>): void {
const overlayContent = event.detail.content;
const overlay = this.overlays.find(
(item) => item.overlayContent === overlayContent
);
this.hideAndCloseOverlay(overlay);
requestAnimationFrame(() => {
const overlayContent = event.detail.content;
const overlay = this.overlays.find(
(item) => item.overlayContent === overlayContent
);
this.hideAndCloseOverlay(overlay);
});
}

private handleMouseCapture = (event: MouseEvent): void => {
Expand Down

0 comments on commit 919b64e

Please sign in to comment.