fix: flyouts resizing for blocks (#6914)

* fix: flyouts resizing for blocks

* chore: fix node build

* chore: actually fix node
This commit is contained in:
Beka Westberg
2023-03-21 15:27:04 -07:00
committed by GitHub
parent 252b204adb
commit a7d250cb78

View File

@@ -220,7 +220,17 @@ function fireInternal(event: Abstract) {
}
if (!FIRE_QUEUE.length) {
// First event added; schedule a firing of the event queue.
setTimeout(fireNow, 0);
try {
// If we are in a browser context, we want to make sure that the event
// fires after blocks have been rerendered this frame.
requestAnimationFrame(() => {
setTimeout(fireNow, 0);
});
} catch (e) {
// Otherwise we just want to delay so events can be coallesced.
// requestAnimationFrame will error triggering this.
setTimeout(fireNow, 0);
}
}
FIRE_QUEUE.push(event);
}