Skip to content

Commit

Permalink
[core] fix(Popover): resolve React synthetic event warning (#6651)
Browse files Browse the repository at this point in the history
Co-authored-by: Braeden Smith <[email protected]>
Co-authored-by: Adi Dahiya <[email protected]>
  • Loading branch information
3 people authored Jan 12, 2024
1 parent deaabf2 commit 0fd5635
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/components/popover/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,11 @@ export class Popover<
// cancel any existing timeout because we have new state
this.cancelOpenTimeout?.();
if (timeout !== undefined && timeout > 0) {
this.cancelOpenTimeout = this.setTimeout(() => this.setOpenState(isOpen, e), timeout);
// Persist the react event since it will be used in a later macrotask.
e?.persist();
this.cancelOpenTimeout = this.setTimeout(() => {
this.setOpenState(isOpen, e);
}, timeout);
} else {
if (this.props.isOpen == null) {
this.setState({ isOpen });
Expand Down

1 comment on commit 0fd5635

@adidahiya
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[core] fix(Popover): resolve React synthetic event warning (#6651)

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Please sign in to comment.