-
Notifications
You must be signed in to change notification settings - Fork 273
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
Wrapped TextInput with editable set to false calls onFocus anyway #1384
Comments
Hello @TMaszko, this happens because the component that wraps the TextInput also has an onFocus prop and since it's not a TextInput from React Native the check on enabled prop is not done. This issue is a duplicate of #1261 so I think we can close this one and continue the discussion on the other issue |
Hi @pierrezimmermannbam I know that but touch responder will have this prop so we can do the additional check like I did in #1385 |
Duplicate of #1261 |
This issue has been resolved in v12.1.2 🚀 |
Describe the bug
When
fireEvent
is called with wrapped TextInput(i.e withstyled-components
) that is disabled the event bubbles up.For example: We want to check if the
TextInput
component is actually disabled we might check whetheronFocus
event handler was called or not.Expected behaviour
onFocus
handler should not be called if theTextInput
is disabled (akaeditable
prop set tofalse
)Steps to Reproduce
https://github.com/TMaszko/FireEventBug
Install dependencies and run
yarn test
Versions
npmPackages:
@testing-library/react-native: ^12.0.1 => 12.0.1
react: 18.2.0 => 18.2.0
react-native: 0.71.6 => 0.71.6
react-test-renderer: ^18.2.0 => 18.2.0
The text was updated successfully, but these errors were encountered: