Skip to content

TextInput Component does not announce "disabled" #30938

Closed

Description

@amarlette

Description

When using a screen reader this component does not announce that it is disabled.

This issue is covered in-depth by parent issue #30840, please check there for more details.

React Native version:

0.63

Activity

  1. added
    Component: TextInput
    Platform: Android
    on Feb 10, 2021
  2. kacieb commented on Feb 11, 2021

    @kacieb
    Contributor

    Issue:
    When accessibilityState={{disabled: true}}, the TextInput is not disabled. The TextInput ignores this in favor of using the editable prop.

    This is fine in my opinion - the TextInput is correctly disabled when editable={false} on both Android and iOS and is unable to be edited. accessibilityState seems to be completely ignored. Perhaps it would be reasonable to add a warning if someone passes in disabled that it will be ignored.

    Repro Component:

    export default function Playground(): React.Node {
      const [editable, setEditable] = React.useState(true);
      const [value, setValue] = React.useState('I am a text input!');
    
      return (
        <View style={styles.container}>
          <Button
            title={
              'press to disable/enable TextInput - currently editable= ' +
              editable.toString()
            }
            onPress={() => {
              setEditable(!editable);
            }}
          />
          <TextInput
            value={value}
            editable={editable}
            accessibilityState={{disabled: true}}
            onChangeText={val => setValue(val)}
          />
        </View>
      );
    }
    
    const styles = StyleSheet.create({
      container: {
        padding: 10,
        paddingTop: 30,
      },
    });
    
  3. kacieb commented on Feb 26, 2021

    @kacieb
    Contributor

    I think we can close this - should be the same issue as #30876

  4. lunaleaps commented on Mar 2, 2021

    @lunaleaps
    Contributor

    @nadiia can we close this per @kacieb's comment?

  5. added
    Good first issue
    and removed on Mar 5, 2021
  6. lunaleaps commented on Apr 29, 2021

    @lunaleaps
    Contributor

    Closing due to #30876

  7. locked as resolved and limited conversation to collaborators on Apr 29, 2022
  8. added
    Resolution: Locked
    on Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AccessibilityComponent: TextInputGood first issuePlatform: AndroidResolution: Locked

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions