Skip to content

TextInput scrollEnabled prop existing crashes on iOS when multiline is false #22949

Closed
@th317erd

Description

@th317erd

Environment

React Native Environment Info:
System:
OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: (6) x64 AMD FX(tm)-6300 Six-Core Processor
Memory: 4.52 GB / 31.32 GB
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 11.6.0 - ~/.nvm/versions/node/v11.6.0/bin/node
npm: 5.7.1 - ~/.nvm/versions/node/v11.6.0/bin/npm
SDKs:
Android SDK:
API Levels: 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
Build Tools: 19.1.0, 20.0.0, 21.1.2, 22.0.1, 23.0.1, 23.0.2, 23.0.3, 24.0.0, 24.0.1, 24.0.2, 24.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 27.0.3
System Images: android-19 | Google APIs Intel x86 Atom, android-21 | Google APIs Intel x86 Atom_64, android-25 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom
npmPackages:
react: 16.6.3 => 16.6.3
react-native: ^0.57.8 => 0.57.8
npmGlobalPackages:
react-native-cli: 2.0.1

Description

On iOS, the application will crash if a scrollEnabled={false || anyValue} if the multiline prop is anything but true. I am attempting to do a <TextInput multiline={multilineEnabled} scrollEnabled={multilineEnabled}/> but this crashes the app when multiline isn't enabled, forcing me to do a workaround using property spreading. This is a bug and should be fixed. The presence of a prop, no matter what the value, should not crash the app.

This was previously reported here, and marked as stale (like MANY of the other ignored / unresolved issues in this community): #21339

Reproducible Demo

On iOS, all you need to do is run a simple vanilla app with the following JSX and the app will crash:
<TextInput multiline={false} scrollEnabled={false}/>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions