Skip to content

Commit 3f7e0a2

Browse files
sherginfacebook-github-bot
authored andcommitted
Removing <TextInput>'s onTextInput event
Summary: This is the first diff in the series. It removes Flow types for this feature to verify that we actually do not have any usages. After it lands, we will remove actual support on the native side. There are several reasons why removing it is a good idea: * There is no any evidence that this feature is actually useful. That was discussed several times (e.g. see T7936714) during RN lifetime and the overall consensus is: We need something else, something like sync `onChange` event instead of it. * Supporting the previous point, it's not used (at least inside Facebook). I searched hard and I could find only one place where it's used: in the TextInput Example. * To deliver more functionality we should lean towards W3C specs, this one is not W3C compliant. * Supporting this Feature in Fabric is quite challenging, so I want to do it sooner than later. * This feature was never documented. Changelog: [Breaking] `<TextInput>::onTextInput` event was removed Reviewed By: TheSavior Differential Revision: D18456175 fbshipit-source-id: c7a8ed7a86b33ecc01d45497645fe249556fdf96
1 parent 9f0b80b commit 3f7e0a2

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Libraries/Components/TextInput/TextInput.js

-8
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,6 @@ export type Props = $ReadOnly<{|
548548
*/
549549
onContentSizeChange?: ?(e: ContentSizeChangeEvent) => mixed,
550550

551-
onTextInput?: ?(e: TextInputEvent) => mixed,
552-
553551
/**
554552
* Callback that is called when text input ends.
555553
*/
@@ -948,7 +946,6 @@ class InternalTextInput extends React.Component<Props> {
948946
onScroll={this._onScroll}
949947
onSelectionChange={this._onSelectionChange}
950948
onSelectionChangeShouldSetResponder={emptyFunctionThatReturnsTrue}
951-
onTextInput={this._onTextInput}
952949
selection={selection}
953950
style={style}
954951
text={this._getText()}
@@ -983,7 +980,6 @@ class InternalTextInput extends React.Component<Props> {
983980
onFocus={this._onFocus}
984981
onScroll={this._onScroll}
985982
onSelectionChange={this._onSelectionChange}
986-
onTextInput={this._onTextInput}
987983
selection={selection}
988984
style={style}
989985
text={this._getText()}
@@ -1111,10 +1107,6 @@ class InternalTextInput extends React.Component<Props> {
11111107
}
11121108
};
11131109

1114-
_onTextInput = (event: TextInputEvent) => {
1115-
this.props.onTextInput && this.props.onTextInput(event);
1116-
};
1117-
11181110
_onScroll = (event: ScrollEvent) => {
11191111
this.props.onScroll && this.props.onScroll(event);
11201112
};

0 commit comments

Comments
 (0)