Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi committed Dec 14, 2024
1 parent b700415 commit 83b75db
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,13 @@ type Props = $ReadOnly<{|

/**
* Array of keys to receive key down events for. These events have their default native behavior prevented.
* Overrides the props `validKeysDown`, `validKeysUp` and `passthroughAllKeyEvents`
*
* @platform macos
*/
keyDownEvents?: ?Array<HandledKeyEvent>,

/**
* Array of keys to receive key up events for. These events have their default native behavior prevented.
* Overrides the props `validKeysDown`, `validKeysUp` and `passthroughAllKeyEvents`
*
* @platform macos
*/
Expand Down
21 changes: 0 additions & 21 deletions packages/react-native/Libraries/Components/View/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ const View: React.AbstractComponent<
nativeID,
tabIndex,
// [macOS
passthroughAllKeyEvents,
validKeysDown,
validKeysUp,
keyDownEvents,
keyUpEvents,
// macOS]
Expand Down Expand Up @@ -101,19 +98,6 @@ const View: React.AbstractComponent<
};
}

// [macOS
let _passthroughAllKeyEvents = passthroughAllKeyEvents;
let _validKeysDown = validKeysDown;
let _validKeysUp = validKeysUp;
if (keyDownEvents || keyUpEvents) {
_passthroughAllKeyEvents = true;
// $FlowFixMe[incompatible-type]
_validKeysDown = keyDownEvents;
// $FlowFixMe[incompatible-type]
_validKeysUp = keyUpEvents;
}
// macOS]

const actualView = (
<ViewNativeComponent
{...otherProps}
Expand All @@ -132,11 +116,6 @@ const View: React.AbstractComponent<
: importantForAccessibility
}
nativeID={id ?? nativeID}
// [macOS
passthroughAllKeyEvents={_passthroughAllKeyEvents}
validKeysDown={_validKeysDown}
validKeysUp={_validKeysUp}
// macOS]
ref={forwardedRef}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,13 @@ export type KeyboardEventProps = $ReadOnly<{|

/**
* Array of keys to receive key down events for. These events have their default native behavior prevented.
* Overrides the props `validKeysDown`, `validKeysUp` and `passthroughAllKeyEvents`
*
* @platform macos
*/
keyDownEvents?: ?Array<HandledKeyEvent>,

/**
* Array of keys to receive key up events for. These events have their default native behavior prevented.
* Overrides the props `validKeysDown`, `validKeysUp` and `passthroughAllKeyEvents`
*
* @platform macos
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/Types/CoreEventTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export interface NativeKeyEvent {
}

/**
* Represents a key that could be passed to `validKeysDown` and `validKeysUp`.
* Represents a key that could be passed to `keyDownEvents` and `keyUpEvents`.
*
* `key` is the actual key, such as "a", or one of the special values:
* "Tab", "Escape", "Enter", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/Types/CoreEventTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export type KeyEvent = SyntheticEvent<
>;

/**
* Represents a key that could be passed to `validKeysDown` and `validKeysUp`.
* Represents a key that could be passed to `KeyDownEvents` and `KeyUpEvents`.
*
* `key` is the actual key, such as "a", or one of the special values:
* "Tab", "Escape", "Enter", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
Expand Down

0 comments on commit 83b75db

Please sign in to comment.