Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why Use getBoundingClientRect to Get Height Instead of offsetHeight #267

Open
425765923 opened this issue Aug 15, 2024 · 0 comments
Open
Assignees

Comments

@425765923
Copy link

Platform targeting (iOS/Android)
IOS
Additional context

In utils.js, the default method used to get the web height is getBoundingClientRect, and a timer is set to ensure that the height is correct before stopping further adjustments. However, getBoundingClientRect returns the height relative to the viewport, so if scrolling occurs during the timer interval, it could lead to incorrect height calculations.

So, why not directly use height = ${element}.offsetHeight to ensure that the correct web height is obtained every time?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants