Skip to content

Commit 9ff43ab

Browse files
zhongwuzwfacebook-github-bot
authored andcommitted
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
1 parent b8246ac commit 9ff43ab

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Libraries/Text/TextInput/Singleline/RCTUITextField.m

+10
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ - (void)setEditable:(BOOL)editable
8787
self.enabled = editable;
8888
}
8989

90+
- (void)setScrollEnabled:(BOOL)enabled
91+
{
92+
// Do noting, compatible with multiline textinput
93+
}
94+
95+
- (BOOL)scrollEnabled
96+
{
97+
return NO;
98+
}
99+
90100
#pragma mark - Context Menu
91101

92102
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender

0 commit comments

Comments
 (0)