You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect offset calculation for elements positioned with transform: translate() in scrollIntoView #7716
Incorrect offset calculation when child elements are positioned with transform: translateY() or translateX().
🤔 Expected Behavior?
The function should return the correct offset even when the child element is positioned using CSS transform: translateY() or translateX().
😯 Current Behavior
The current function only considers offsetTop and offsetLeft, which do not account for elements transformed using translateY() or translateX(). This results in incorrect positioning calculations.
💁 Possible Solution
Use getBoundingClientRect() to calculate the relative offset instead of relying on offsetTop and offsetLeft.
🔦 Context
No response
🖥️ Steps to Reproduce
Create an element inside an ancestor with transform: translateY(100px);
Use the current function to compute its relative offset
Observe that the function does not account for the transformed position
@LFDanLu This is issue is pretty old. Its possible solution calls for getBoundingClientRect(), which we already use, so I believe this is already resolved and unrelated to the jumps.
Activity
LFDanLu commentedon Aug 12, 2026
putting this one under #10182 since it should be covered by a fix to that scroll code a well
nwidynski commentedon Aug 13, 2026
@LFDanLu This is issue is pretty old. Its possible solution calls for getBoundingClientRect(), which we already use, so I believe this is already resolved and unrelated to the jumps.