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 @@ -1089,6 +1089,22 @@ interface TextInputState {
1089
1089
* noop if it wasn't focused
1090
1090
*/
1091
1091
blurTextInput ( textField ?: HostInstance ) : void ;
1092
+
1093
+ // [macOS
1094
+ /**
1095
+ * @param textField ref of the text field that was focused
1096
+ * Call on custom implementations of TextInput to notify the control was focused
1097
+ * noop if it was already focused
1098
+ */
1099
+ onTextInputFocus ( textField ?: HostInstance ) : void ;
1100
+
1101
+ /**
1102
+ * @param textField ref of the text field that was blurred
1103
+ * Call on custom implementations of TextInput to notify the control was blurred
1104
+ * noop if it wasn't focused
1105
+ */
1106
+ onTextInputBlur ( textField ?: HostInstance ) : void ;
1107
+ // macOS]
1092
1108
}
1093
1109
1094
1110
/**
Original file line number Diff line number Diff line change @@ -1255,6 +1255,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
1255
1255
currentlyFocusedField : ( ) => ?number ,
1256
1256
focusTextInput : ( textField : ?HostInstance ) => void ,
1257
1257
blurTextInput : ( textField : ?HostInstance ) => void ,
1258
+ onTextInputFocus : ( textField : ?HostInstance ) => void , // [macOS]
1259
+ onTextInputBlur : ( textField : ?HostInstance ) => void , // [macOS]
1258
1260
| } > ,
1259
1261
| } > ;
1260
1262
Original file line number Diff line number Diff line change @@ -2045,6 +2045,8 @@ ExportedForwardRef.State = {
2045
2045
currentlyFocusedField : TextInputState . currentlyFocusedField ,
2046
2046
focusTextInput : TextInputState . focusTextInput ,
2047
2047
blurTextInput : TextInputState . blurTextInput ,
2048
+ onTextInputFocus : TextInputState . focusInput , // [macOS]
2049
+ onTextInputBlur : TextInputState . blurInput , // [macOS]
2048
2050
} ;
2049
2051
2050
2052
export type TextInputComponentStatics = $ReadOnly < { |
@@ -2053,6 +2055,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
2053
2055
currentlyFocusedField : typeof TextInputState . currentlyFocusedField ,
2054
2056
focusTextInput : typeof TextInputState . focusTextInput ,
2055
2057
blurTextInput : typeof TextInputState . blurTextInput ,
2058
+ onTextInputFocus : typeof TextInputState . focusInput , // [macOS]
2059
+ onTextInputBlur : typeof TextInputState . blurInput , // [macOS]
2056
2060
| } > ,
2057
2061
| } > ;
2058
2062
Original file line number Diff line number Diff line change @@ -3304,6 +3304,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
3304
3304
currentlyFocusedField: () => ?number,
3305
3305
focusTextInput: (textField: ?HostInstance) => void,
3306
3306
blurTextInput: (textField: ?HostInstance) => void,
3307
+ onTextInputFocus: (textField: ?HostInstance) => void,
3308
+ onTextInputBlur: (textField: ?HostInstance) => void,
3307
3309
|}>,
3308
3310
|}>;
3309
3311
export type TextInputType = InternalTextInput & TextInputComponentStatics;
@@ -3703,6 +3705,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
3703
3705
currentlyFocusedField: typeof TextInputState.currentlyFocusedField,
3704
3706
focusTextInput: typeof TextInputState.focusTextInput,
3705
3707
blurTextInput: typeof TextInputState.blurTextInput,
3708
+ onTextInputFocus: typeof TextInputState.focusInput,
3709
+ onTextInputBlur: typeof TextInputState.blurInput,
3706
3710
|}>,
3707
3711
|}>;
3708
3712
declare module.exports: TextInputType;
You can’t perform that action at this time.
0 commit comments