Support "editable" on TextInput
See original GitHub issueDescribe the Feature
TextInput
component from react-native
has its own handling of being disabled/editable. It’s not using responder system like Views, Texts and thus Touchables, so the logic we have already fails to catch it.
We should consider adding custom handling specific to native TextInput component, since it was working with @testing-library/react-native
before v7.
Possible Implementations
Will likely involve detecting TextInput
and verify if it’s editable or not.
Test that fails with current implementation:
test('should not fire on disabled TextInput', () => {
const handleChangeText = jest.fn();
const screen = render(
<TextInput onChangeText={handleChangeText} editable={false}>
<Text>Trigger</Text>
</TextInput>
);
fireEvent.changeText(screen.getByText('Trigger'), 'Trigger');
expect(handleChangeText).not.toHaveBeenCalled();
});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:10 (5 by maintainers)
Top Results From Across the Web
TextInput - React Native
A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, such as auto- ...
Read more >Change TextInput editable attribute when I press a button
I would like to change all my TextInput's editable value to editable when i press on the button "Editer". I tried some things...
Read more >ARIA: textbox role - Accessibility - MDN Web Docs
The textbox role is used to identify an element that allows the input ... HTML contenteditable attribute ensures the text node is editable....
Read more >Editing inputs - IBM
Edit and configure the inputs in your service. An input is automatically populated in your service for each variable in the workflow definition...
Read more >Textbox in Edit form keep text input by user
I have create a editable form that select item from gallery. I am wondering, one textbox name: "Note" keep text that user input...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
fireEvent(textInput, 'focus')
still working wheneditable={false}
😢I’m using version 11.0.0.
Result:
@pitpitpat go for it!