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

fix: adjust highlighters for Android tablets #1162

Merged
merged 1 commit into from Oct 31, 2023

Conversation

eglitise
Copy link
Collaborator

This PR fixes an issue where element highlighters for Android tablets were being drawn incorrectly.
The core issue stems from the deviceScreenSize parameters, which appear to match portrait mode for phones, but landscape mode for tablets. This has now been adjusted for.
Resolves #1154.

@eglitise eglitise added the fix This resolves a user-facing problem label Oct 31, 2023
const [width, height] = deviceScreenSize.split('x');
if (windowSize.height > windowSize.width) { // portrait mode
if ((windowSize.height > windowSize.width && height > width) || // phone portrait mode
Copy link
Contributor

Choose a reason for hiding this comment

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

should it be >= instead of > ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's definitely an edgecase. If the dimensions are equal for both windowSize and deviceScreenSize, then either branch is fine. The only way problems could arise is if width == height, but windowSize.height != windowSize.width. I'm not sure how likely this is to actually happen.

Copy link
Member

Choose a reason for hiding this comment

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

I'm also finding this condition a bit hard to read. Would it make more sense to reverse it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created #1163 to adjust this

@eglitise eglitise merged commit 584a8e0 into appium:main Oct 31, 2023
5 checks passed
@eglitise eglitise deleted the fix-android-tablet-highlighters branch October 31, 2023 18:18
shiva-guntoju pushed a commit to shiva-guntoju/appium-inspector that referenced this pull request Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix This resolves a user-facing problem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: The click point does not match the accurate position of the element in latest version(2023.10.4)
3 participants