Skip to content
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

TextInput ScrollEnabled causes unrecognized selector crash #21339

Closed
3 tasks done
L-Yeiser opened this issue Sep 26, 2018 · 4 comments
Closed
3 tasks done

TextInput ScrollEnabled causes unrecognized selector crash #21339

L-Yeiser opened this issue Sep 26, 2018 · 4 comments
Labels
Component: TextInput Related to the TextInput component. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@L-Yeiser
Copy link

L-Yeiser commented Sep 26, 2018

Environment

  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.5
      CPU: x64 Intel(R) Core(TM) i5-4288U CPU @ 2.60GHz
      Memory: 113.60 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.9.3 - /usr/local/bin/node
      Yarn: 1.3.2 - /usr/local/bin/yarn
      npm: 5.5.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        Build Tools: 23.0.1, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.2, 27.0.3
        API Levels: 21, 23, 25, 26, 27
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0
      react-native: 0.57.1 => 0.57.1
    npmGlobalPackages:
      create-react-native-app: 2.0.2
      react-native-cli: 2.0.1

Description

Adding ScrollEnabled to TextInput causes the following error:
screen shot 2018-09-26 at 9 54 48 am

Reproducible Demo

Reproduced in this app: https://github.com/L-Yeiser/TextInputBug. App created with react-native init. Replaced introductory text in App.js with <TextInput scrollEnabled={false} />

@react-native-bot react-native-bot added Component: TextInput Related to the TextInput component. 🔶Components labels Sep 26, 2018
@ggtmtmgg
Copy link
Contributor

@L-Yeiser
<TextInput scrollEnabled={false} /> only works with multiline={true}.

https://facebook.github.io/react-native/docs/textinput#scrollenabled

@L-Yeiser
Copy link
Author

L-Yeiser commented Sep 29, 2018

@ggtmtmgg you are right and I should have been clearer in my issue description. Passing the scrollEnabled prop without multiline causes the above error - even when the value is scrollEnabled={true}. When docs say that scrollEnabled=false does not work without multiline=true my assumption is that the property will not work (aka it is not a multiline text there is no scroll to disable) not that the app will crash. We have a re-usable TextInput component with a handful of default props. It is easy enough to add protection to not pass the scrollEnabled prop without the multiline prop but it does feel like a bug that passing one property without the other causes a fetal error. It would be nice if something like this was possible

type Props = {
  scrollEnabled: boolean,
  multiline: boolean,
};

export default class App extends Component<Props> {
  static defaultProps = {
    scrollEnabled: true,
    multiline: false,
  };

  render() {
    return (
      <View style={styles.container}>
        <TextInput
          {...this.props}
        />
      </View>
    );
  }
}

@stale
Copy link

stale bot commented Dec 29, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 29, 2018
@stale
Copy link

stale bot commented Jan 6, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 6, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Jan 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: TextInput Related to the TextInput component. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants