mirror of
https://github.com/google/blockly.git
synced 2026-01-15 04:47:10 +01:00
fix: flyouts resizing for blocks (#6914)
* fix: flyouts resizing for blocks * chore: fix node build * chore: actually fix node
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user