Fixing the overlay perf issue and modal's jumping to top, which was caused by the focus event.