Skip to content

Commit

Permalink
Prevent crash when scrollEnabled used in singleline textinput (#23361)
Browse files Browse the repository at this point in the history
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 9ff43ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Libraries/Text/TextInput/Singleline/RCTUITextField.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9ff43ab

Please sign in to comment.