Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(module:modal): call
focus()
on the next rendering frame to pre…
…vent frame drop (#7293) Calling `focus()` on the element causes browsers to do re-layouts. This can been seen here: https://gist.github.com/paulirish/5d52fb081b3570c81e3a#setting-focus Microtasks are executed asynchronously, but within the current rendering frame. Using `requestAnimationFrame` except of `Promise.resolve` basically unloads the current frame and calls `focus()` on the next rendering frame, this prevent frame drops on slower devices when the modal is opened.
- Loading branch information