Prevent crash when scrollEnabled used in singleline textinput (#23361)

Summary:
Fixes #22949 , #21339. Currently, multiline textInput uses `UITextView` but singleline textInput uses `UITextField`, so singleline textinput may crash when use `scrollEnabled` property.

[iOS] [Fixed] - Prevent crash when scrollEnabled used in singleline textinput
Pull Request resolved: https://github.com/facebook/react-native/pull/23361

Differential Revision: D14030586

Pulled By: cpojer

fbshipit-source-id: a8ae1b4e168469e65745c4d5e9329df8b6faa2aa
This commit is contained in:
zhongwuzw 2019-02-11 14:29:22 -08:00 committed by Facebook Github Bot
parent b8246ac89a
commit 9ff43abe65
1 changed files with 10 additions and 0 deletions

View File

@ -87,6 +87,16 @@
self.enabled = editable;
}
- (void)setScrollEnabled:(BOOL)enabled
{
// Do noting, compatible with multiline textinput
}
- (BOOL)scrollEnabled
{
return NO;
}
#pragma mark - Context Menu
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender