Skip to content

Conversation

@chaim-aharonson-applitools
Copy link
Contributor

The issue is relevant for cases of narrow screens (e.g. mobile), it causes the value of documentElement.scrollWidth to be wrong since the code of calculation and placement (aka: innerHTML) is actually changing the width by itself.
This fix makes sure to set the actual width value in case the firstly calculated width is not the actual width.
re-calling the method updateData() twice will also result the correct width.

sH.innerHTML = document.documentElement.scrollHeight + " px";
cW.innerHTML = document.documentElement.clientWidth + " px";
cH.innerHTML = document.documentElement.clientHeight + " px";
// recheck the final 'scrollWidth' to ensure it was not changed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// recheck the final 'scrollWidth' to ensure it was not changed
// re-check the final 'scrollWidth' to ensure it was not changed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tal-applitool this is such an old PR, can't even say what was done there and whether it's relevant at all

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants