-
Notifications
You must be signed in to change notification settings - Fork 273
Querying by role with name on nested touchables return multiple elements #1152
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
Comments
I think that this might actually be a more general aspect of out tree walking code that uses I imagine that it also should manifest itself for any scenario with matching nested elements, like: <View accessiblityLabel="hello">
<View accessiblityLabel="hello">
<Text>Hello</Text>
</View>
</View> or <View accessiblityStates={{ disabled: true }}>
<View accessiblityStates={{ disabled: true }}>
<Text>Hello</Text>
</View>
</View> Essentially for any case when component structure allows for nesting elements matching query predicate, it currently will result in matching both the inner and outer one. This might be more visible in certain scenarios like It seems that RTL/DTL should behave the same as our code because their queries rely on using I think we should first investigate how RTL would behave in a similar case, and then decide if this is a bug or a feature. |
Overall I agree, that sounds fair and we should probably use the same API/behaviour. I do think the |
Regarding the original tests mentioned in this issue, we should consider excluding elements with explicit @AugustinLF wdyt? |
Yes, I think that'd be a great start! |
Closing in favour of #1180 with more clear scope. |
Describe the bug
We have a problem when querying nested touchables, see the example for more details:
Versions
RNTL 11.2
The text was updated successfully, but these errors were encountered: