diff --git a/core/events/utils.ts b/core/events/utils.ts index 4c3ca57cd..e8505f38d 100644 --- a/core/events/utils.ts +++ b/core/events/utils.ts @@ -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); }