Background
We use useViewportOffsetTop to properly display keyboard on small device on the mobile browsers
Problem
We noticed that window.scrollTo is being called frequently in useViewportOffsetTop, even when the target scroll position has already been reached. This logic is primarily necessary for small screens when using the app in a browser, but it is triggered unnecessarily on all devices.
Calling window.scrollTo causes redundant style recalculations, which can take up to 13ms.

Solution
We can add an additional check to prevent window.scrollTo from being triggered when the scroll position is already at the target. This optimization will eliminate unnecessary style recalculations and improve overall performance.
Issue Owner
Current Issue Owner: @maddylewis
Background
We use
useViewportOffsetTopto properly display keyboard on small device on the mobile browsersProblem
We noticed that
window.scrollTois being called frequently inuseViewportOffsetTop, even when the target scroll position has already been reached. This logic is primarily necessary for small screens when using the app in a browser, but it is triggered unnecessarily on all devices.Calling
window.scrollTocauses redundant style recalculations, which can take up to 13ms.Solution
We can add an additional check to prevent
window.scrollTofrom being triggered when the scroll position is already at the target. This optimization will eliminate unnecessary style recalculations and improve overall performance.Issue Owner
Current Issue Owner: @maddylewis