Find element work for non hitTestable elements.#39
Open
IvanPalamarchuk wants to merge 1 commit intoAppiumTestDistribution:mainfrom
Open
Find element work for non hitTestable elements.#39IvanPalamarchuk wants to merge 1 commit intoAppiumTestDistribution:mainfrom
IvanPalamarchuk wants to merge 1 commit intoAppiumTestDistribution:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello!
I’d like to suggest some improvements to the library. > Our team has been using this approach for over a year now, and it has been working perfectly for us in production.
Subject: Improve visibility detection by adding a fallback for non-RenderBox elements
Description:
This PR enhances the visibility check logic to handle cases where
hitTestable()might incorrectly return false for elements that are technically present on the screen.While
hitTestable()is effective for standard interactive elements, it has limitations in the following scenarios:Non-RenderBox Elements: Widgets like
SliverList,SliverGrid,InheritedWidget, orBuilderdo not have aRenderBox. The proposed logic ensures that if aRenderObjectis not aRenderBox, we treat it as visible to allow traversal of its children.Pointer Interactivity: Elements wrapped in
IgnorePointerare visually present but fail hit-testing by design.Edge Cases with Opacity & HitTestBehavior: Depending on the HitTestBehavior, elements with specific hit-test configurations might be skipped by hitTestable() even if they exist in the tree and visible on the screen.
Offstage Widgets: Provides a more predictable way to distinguish between widgets that are simply off-screen versus those explicitly hidden via Offstage.
Conclusion:
The
isVisibleOnAppScreen()method acts as a necessary fallback. It ensures that the library doesn't skip elements that are visually or structurally important but "invisible" to the standard pointer-based hit-testing mechanism.