File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed
packages/react-native/Libraries Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1084,6 +1084,22 @@ interface TextInputState {
1084
1084
* noop if it wasn't focused
1085
1085
*/
1086
1086
blurTextInput ( textField ?: HostInstance ) : void ;
1087
+
1088
+ // [macOS
1089
+ /**
1090
+ * @param textField ref of the text field that was focused
1091
+ * Call on custom implementations of TextInput to notify the control was focused
1092
+ * noop if it was already focused
1093
+ */
1094
+ onTextInputFocus ( textField ?: HostInstance ) : void ;
1095
+
1096
+ /**
1097
+ * @param textField ref of the text field that was blurred
1098
+ * Call on custom implementations of TextInput to notify the control was blurred
1099
+ * noop if it wasn't focused
1100
+ */
1101
+ onTextInputBlur ( textField ?: HostInstance ) : void ;
1102
+ // macOS]
1087
1103
}
1088
1104
1089
1105
/**
Original file line number Diff line number Diff line change @@ -1249,6 +1249,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
1249
1249
currentlyFocusedField : ( ) => ?number ,
1250
1250
focusTextInput : ( textField : ?HostInstance ) => void ,
1251
1251
blurTextInput : ( textField : ?HostInstance ) => void ,
1252
+ onTextInputFocus : ( textField : ?HostInstance ) => void , // [macOS]
1253
+ onTextInputBlur : ( textField : ?HostInstance ) => void , // [macOS]
1252
1254
| } > ,
1253
1255
| } > ;
1254
1256
Original file line number Diff line number Diff line change @@ -2039,6 +2039,8 @@ ExportedForwardRef.State = {
2039
2039
currentlyFocusedField : TextInputState . currentlyFocusedField ,
2040
2040
focusTextInput : TextInputState . focusTextInput ,
2041
2041
blurTextInput : TextInputState . blurTextInput ,
2042
+ onTextInputFocus : TextInputState . focusInput , // [macOS]
2043
+ onTextInputBlur : TextInputState . blurInput , // [macOS]
2042
2044
} ;
2043
2045
2044
2046
export type TextInputComponentStatics = $ReadOnly < { |
@@ -2047,6 +2049,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
2047
2049
currentlyFocusedField : typeof TextInputState . currentlyFocusedField ,
2048
2050
focusTextInput : typeof TextInputState . focusTextInput ,
2049
2051
blurTextInput : typeof TextInputState . blurTextInput ,
2052
+ onTextInputFocus : typeof TextInputState . focusInput , // [macOS]
2053
+ onTextInputBlur : typeof TextInputState . blurInput , // [macOS]
2050
2054
| } > ,
2051
2055
| } > ;
2052
2056
Original file line number Diff line number Diff line change @@ -3231,6 +3231,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
3231
3231
currentlyFocusedField: () => ?number,
3232
3232
focusTextInput: (textField: ?HostInstance) => void,
3233
3233
blurTextInput: (textField: ?HostInstance) => void,
3234
+ onTextInputFocus: (textField: ?HostInstance) => void,
3235
+ onTextInputBlur: (textField: ?HostInstance) => void,
3234
3236
|}>,
3235
3237
|}>;
3236
3238
export type TextInputType = InternalTextInput & TextInputComponentStatics;
@@ -3629,6 +3631,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
3629
3631
currentlyFocusedField: typeof TextInputState.currentlyFocusedField,
3630
3632
focusTextInput: typeof TextInputState.focusTextInput,
3631
3633
blurTextInput: typeof TextInputState.blurTextInput,
3634
+ onTextInputFocus: typeof TextInputState.focusInput,
3635
+ onTextInputBlur: typeof TextInputState.blurInput,
3632
3636
|}>,
3633
3637
|}>;
3634
3638
declare module.exports: TextInputType;
You can’t perform that action at this time.
0 commit comments