@@ -29,6 +29,11 @@ import type {
2929 LayoutEvent ,
3030 MouseEvent ,
3131 PressEvent ,
32+ // [TODO(macOS GH#774)
33+ FocusEvent ,
34+ BlurEvent ,
35+ KeyEvent ,
36+ // ]TODO(macOS GH#774)
3237} from '../../Types/CoreEventTypes' ;
3338import type { DraggedTypesType } from '../View/DraggedType' ; // TODO(macOS GH#774)
3439import View from '../View/View' ;
@@ -130,6 +135,40 @@ type Props = $ReadOnly<{|
130135 */
131136 onPressOut ?: ?( event : PressEvent ) => void ,
132137
138+ // [TODO(macOS GH#774)
139+ /**
140+ * Called after the element is focused.
141+ */
142+ onFocus ?: ?( event : FocusEvent ) => mixed ,
143+
144+ /**
145+ * Called after the element loses focus.
146+ */
147+ onBlur ?: ?( event : BlurEvent ) => mixed ,
148+
149+ /**
150+ * Called after a key down event is detected.
151+ */
152+ onKeyDown ?: ?( event : KeyEvent ) => mixed ,
153+
154+ /**
155+ * Called after a key up event is detected.
156+ */
157+ onKeyUp ?: ?( event : KeyEvent ) => mixed ,
158+
159+ /**
160+ * Array of keys to receive key down events for
161+ * For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
162+ */
163+ validKeysDown ?: ?Array < string > ,
164+
165+ /**
166+ * Array of keys to receive key up events for
167+ * For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
168+ */
169+ validKeysUp ?: ?Array < string > ,
170+ // ]TODO(macOS GH#774)
171+
133172 /**
134173 * Either view styles or a function that receives a boolean reflecting whether
135174 * the component is currently pressed and returns view styles.
@@ -197,6 +236,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
197236 onPress,
198237 onPressIn,
199238 onPressOut,
239+ // [TODO(macOS GH#774)
240+ onFocus,
241+ onBlur,
242+ onKeyDown,
243+ onKeyUp,
244+ // ]TODO(macOS GH#774)
200245 pressRetentionOffset,
201246 style,
202247 testOnly_pressed,
@@ -256,6 +301,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
256301 onPressOut ( event ) ;
257302 }
258303 } ,
304+ // [TODO(macOS GH#774)
305+ onFocus ,
306+ onBlur ,
307+ onKeyDown ,
308+ onKeyUp ,
309+ // ]TODO(macOS GH#774)
259310 } ) ,
260311 [
261312 android_disableSound ,
@@ -271,6 +322,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
271322 onPress ,
272323 onPressIn ,
273324 onPressOut ,
325+ // [TODO(macOS GH#774)
326+ onFocus ,
327+ onBlur ,
328+ onKeyDown ,
329+ onKeyUp ,
330+ // ]TODO(macOS GH#774)
274331 pressRetentionOffset ,
275332 setPressed ,
276333 unstable_pressDelay ,
0 commit comments