How to use the react-native-windows.HandledEventPhase.Bubbling function in react-native-windows

To help you get started, we’ve selected a few react-native-windows examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / react-native-windows / vnext / src / RNTester / js / KeyboardExtensionExample.windows.tsx View on Github external
interface IKeyboardableComponentState {
  lastKeyDown: string | null;
  lastKeyUp: string | null;
  lastKeyDownCapture: string | null;
  lastKeyUpCapture: string | null;
  lastKeyDownCode: string | null;
  lastKeyUpCode: string | null;
  lastKeyDownCaptureCode: string | null;
  lastKeyUpCaptureCode: string | null;
}

const handledNativeKeyboardEvents: IHandledKeyboardEvent[] = [
  {code: 'KeyA', handledEventPhase: HandledEventPhase.Capturing},
  {code: 'KeyB'},
  {code: 'Digit1', handledEventPhase: HandledEventPhase.Bubbling},
  {code: 'Tab', handledEventPhase: HandledEventPhase.Capturing},
];

class ViewWindowsKeyboardExample extends React.Component<
  {},
  IKeyboardableComponentState
> {
  public constructor(props: {}) {
    super(props);
    this.state = {
      lastKeyDown: null,
      lastKeyUp: null,
      lastKeyDownCapture: null,
      lastKeyUpCapture: null,
      lastKeyDownCode: null,
      lastKeyUpCode: null,