Skip to content

Commit

Permalink
Fix flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Klemenski committed Jun 22, 2021
1 parent c9df219 commit 2c09a24
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions vnext/src/Libraries/Components/View/View.windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ import ViewNativeComponent from './ViewNativeComponent';
import TextAncestor from '../../Text/TextAncestor';
import * as React from 'react';
import invariant from 'invariant'; // [Windows]
// [Windows
import type {
KeyEvent,
} from '../../Types/CoreEventTypes';
// Windows]

export type Props = ViewProps;

Expand All @@ -29,7 +34,7 @@ const View: React.AbstractComponent<
React.ElementRef<typeof ViewNativeComponent>,
> = React.forwardRef((props: ViewProps, forwardedRef) => {
const _keyDown = (event: KeyEvent) => {
if (props.keyDownEvents && !event.isPropagationStopped()) {
if (props.keyDownEvents && !event.isPropagationStopped) {
for (const el of props.keyDownEvents) {
if (event.nativeEvent.code == el.code && el.handledEventPhase == 3) {
event.stopPropagation();
Expand All @@ -40,7 +45,7 @@ const View: React.AbstractComponent<
};

const _keyUp = (event: KeyEvent) => {
if (props.keyUpEvents && !event.isPropagationStopped()) {
if (props.keyUpEvents && !event.isPropagationStopped) {
for (const el of props.keyUpEvents) {
if (event.nativeEvent.code == el.code && el.handledEventPhase == 3) {
event.stopPropagation();
Expand All @@ -51,7 +56,7 @@ const View: React.AbstractComponent<
};

const _keyDownCapture = (event: KeyEvent) => {
if (props.keyDownEvents && !event.isPropagationStopped()) {
if (props.keyDownEvents && !event.isPropagationStopped) {
for (const el of props.keyDownEvents) {
if (event.nativeEvent.code == el.code && el.handledEventPhase == 1) {
event.stopPropagation();
Expand All @@ -62,8 +67,8 @@ const View: React.AbstractComponent<
};

const _keyUpCapture = (event: KeyEvent) => {
if (props.keyUpEvents) {
for (const el of props.keyUpEvents && !event.isPropagationStopped()) {
if (props.keyUpEvents && !event.isPropagationStopped) {
for (const el of props.keyUpEvents) {
if (event.nativeEvent.code == el.code && el.handledEventPhase == 1) {
event.stopPropagation();
}
Expand Down

0 comments on commit 2c09a24

Please sign in to comment.