Replace setImmediate with setTimeout (#12614)
This commit is contained in:
committed by
GitHub
parent
21ae29c002
commit
8b4e3e6647
@@ -170,7 +170,7 @@ export default class ContextMenu extends React.PureComponent<React.PropsWithChil
|
||||
|
||||
// XXX: This isn't pretty but the only way to allow opening a different context menu on right click whilst
|
||||
// a context menu and its click-guard are up without completely rewriting how the context menus work.
|
||||
setImmediate(() => {
|
||||
setTimeout(() => {
|
||||
const clickEvent = new MouseEvent("contextmenu", {
|
||||
clientX: x,
|
||||
clientY: y,
|
||||
@@ -180,7 +180,7 @@ export default class ContextMenu extends React.PureComponent<React.PropsWithChil
|
||||
relatedTarget: null,
|
||||
});
|
||||
document.elementFromPoint(x, y)?.dispatchEvent(clickEvent);
|
||||
});
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ export default class PictureInPictureDragger extends React.Component<IProps> {
|
||||
this.mouseHeld = false;
|
||||
// Delaying this to the next event loop tick is necessary for click
|
||||
// event cancellation to work
|
||||
setImmediate(() => (this.moving = false));
|
||||
setTimeout(() => (this.moving = false));
|
||||
this.snap(true);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user