Skip to content

Commit b5fd5d0

Browse files
sammy-SCgrabbou
authored andcommitted
Remove setMostRecentEventCount from TextInput view commands
Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b
1 parent 1f7b0b3 commit b5fd5d0

File tree

8 files changed

+4
-66
lines changed

8 files changed

+4
-66
lines changed

Libraries/Components/TextInput/AndroidTextInputNativeComponent.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,7 @@ type NativeType = HostComponent<NativeProps>;
544544
type NativeCommands = TextInputNativeCommands<NativeType>;
545545

546546
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
547-
supportedCommands: [
548-
'focus',
549-
'blur',
550-
'setMostRecentEventCount',
551-
'setTextAndSelection',
552-
],
547+
supportedCommands: ['focus', 'blur', 'setTextAndSelection'],
553548
});
554549

555550
let AndroidTextInputNativeComponent;

Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ type NativeType = HostComponent<mixed>;
2222
type NativeCommands = TextInputNativeCommands<NativeType>;
2323

2424
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
25-
supportedCommands: [
26-
'focus',
27-
'blur',
28-
'setMostRecentEventCount',
29-
'setTextAndSelection',
30-
],
25+
supportedCommands: ['focus', 'blur', 'setTextAndSelection'],
3126
});
3227

3328
const SinglelineTextInputNativeComponent: HostComponent<mixed> = requireNativeComponent<mixed>(

Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ type NativeType = HostComponent<mixed>;
2424
type NativeCommands = TextInputNativeCommands<NativeType>;
2525

2626
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
27-
supportedCommands: [
28-
'focus',
29-
'blur',
30-
'setMostRecentEventCount',
31-
'setTextAndSelection',
32-
],
27+
supportedCommands: ['focus', 'blur', 'setTextAndSelection'],
3328
});
3429

3530
let SinglelineTextInputNativeComponent;

Libraries/Components/TextInput/TextInputNativeCommands.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ import type {Int32} from '../../Types/CodegenTypes';
1717
export interface TextInputNativeCommands<T> {
1818
+focus: (viewRef: React.ElementRef<T>) => void;
1919
+blur: (viewRef: React.ElementRef<T>) => void;
20-
+setMostRecentEventCount: (
21-
viewRef: React.ElementRef<T>,
22-
eventCount: Int32,
23-
) => void;
2420
+setTextAndSelection: (
2521
viewRef: React.ElementRef<T>,
2622
mostRecentEventCount: Int32,
@@ -30,11 +26,6 @@ export interface TextInputNativeCommands<T> {
3026
) => void;
3127
}
3228

33-
const supportedCommands = [
34-
'focus',
35-
'blur',
36-
'setMostRecentEventCount',
37-
'setTextAndSelection',
38-
];
29+
const supportedCommands = ['focus', 'blur', 'setTextAndSelection'];
3930

4031
export default supportedCommands;

Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,6 @@ - (void)setBridge:(RCTBridge *)bridge
117117
}];
118118
}
119119

120-
RCT_EXPORT_METHOD(setMostRecentEventCount : (nonnull NSNumber *)viewTag eventCount:(NSInteger)eventCount)
121-
{
122-
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
123-
RCTBaseTextInputView *view = (RCTBaseTextInputView *)viewRegistry[viewTag];
124-
view.mostRecentEventCount = eventCount;
125-
}];
126-
}
127-
128120
RCT_EXPORT_METHOD(setTextAndSelection : (nonnull NSNumber *)viewTag
129121
mostRecentEventCount : (NSInteger)mostRecentEventCount
130122
value : (NSString *)value

React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,6 @@ - (void)blur
407407
[_backedTextInputView resignFirstResponder];
408408
}
409409

410-
- (void)setMostRecentEventCount:(NSInteger)eventCount
411-
{
412-
_mostRecentEventCount = eventCount;
413-
}
414-
415410
- (void)setTextAndSelection:(NSInteger)eventCount
416411
value:(NSString *__nullable)value
417412
start:(NSInteger)start

React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ NS_ASSUME_NONNULL_BEGIN
1414
@protocol RCTTextInputViewProtocol <NSObject>
1515
- (void)focus;
1616
- (void)blur;
17-
- (void)setMostRecentEventCount:(NSInteger)eventCount;
1817
- (void)setTextAndSelection:(NSInteger)eventCount
1918
value:(NSString *__nullable)value
2019
start:(NSInteger)start
@@ -50,27 +49,6 @@ RCTTextInputHandleCommand(id<RCTTextInputViewProtocol> componentView, NSString c
5049
return;
5150
}
5251

53-
if ([commandName isEqualToString:@"setMostRecentEventCount"]) {
54-
#if RCT_DEBUG
55-
if ([args count] != 1) {
56-
RCTLogError(
57-
@"%@ command %@ received %d arguments, expected %d.", @"TextInput", commandName, (int)[args count], 1);
58-
return;
59-
}
60-
#endif
61-
62-
NSObject *arg0 = args[0];
63-
#if RCT_DEBUG
64-
if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSNumber class], @"number", @"TextInput", commandName, @"1st")) {
65-
return;
66-
}
67-
#endif
68-
NSInteger eventCount = [(NSNumber *)arg0 intValue];
69-
70-
[componentView setMostRecentEventCount:eventCount];
71-
return;
72-
}
73-
7452
if ([commandName isEqualToString:@"setTextAndSelection"]) {
7553
#if RCT_DEBUG
7654
if ([args count] != 4) {

ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,6 @@ public void receiveCommand(
230230
case "blurTextInput":
231231
reactEditText.clearFocusFromJS();
232232
break;
233-
case "setMostRecentEventCount":
234-
// TODO: delete, this is no longer used from JS
235-
break;
236233
case "setTextAndSelection":
237234
int mostRecentEventCount = args.getInt(0);
238235
if (mostRecentEventCount == UNSET) {

0 commit comments

Comments
 (0)