Skip to content

Bug: Non-editable TextInputs are updated via fireEvent.changeText() when wrapped within 2 components down #1261

Closed
@ylemberg

Description

@ylemberg

Describe the bug

I have an issue very similar to #476. However this reproduces once the <TextInput /> is nested within 2 components.

I created a Github repo to demonstrate this issue.

Expected behavior

A <TextInput/> that is nested within 2 components or more should not have the fireEvent.changeText() invoke the onChangeText() callback and the test in the above repo "should not fire on non-editable SecondTextInputWrapper" should pass

Steps to Reproduce

  1. Clone the repository https://github.com/ylemberg/text-input-spec-example
  2. Run yarn install
  3. Run yarn test

Screenshots

Screen Shot 2022-12-19 at 5 50 27 PM

Versions

"devDependencies": {
    "@babel/core": "^7.18.0",
    "@babel/preset-typescript": "^7.17.12",
    "@babel/runtime": "^7.18.0",
    "@testing-library/jest-native": "3.4.3",
    "@testing-library/react-native": "^11.5.0",
    "@types/jest": "^29.2.4",
    "babel-plugin-module-resolver": "^4.1.0",
    "cross-env": "^7.0.3",
    "jest": "26.6.3",
    "react": "17.0.2",
    "react-native": "0.66.5",
    "react-test-renderer": "^17.0.2",
    "typescript": "^4.2.0"
  }

https://github.com/ylemberg/text-input-spec-example/blob/main/package.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions