Skip to content
Permalink
Browse files

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: #23361

Differential Revision: D14030586

Pulled By: cpojer

fbshipit-source-id: a8ae1b4e168469e65745c4d5e9329df8b6faa2aa
  • Loading branch information...
zhongwuzw authored and facebook-github-bot committed Feb 11, 2019
1 parent b8246ac commit 9ff43abe653ac5af0e591b369228f0809caad204
Showing with 10 additions and 0 deletions.
  1. +10 −0 Libraries/Text/TextInput/Singleline/RCTUITextField.m
@@ -87,6 +87,16 @@ - (void)setEditable:(BOOL)editable
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

0 comments on commit 9ff43ab

Please sign in to comment.
You can’t perform that action at this time.