diff --git a/src/component/handlers/edit/editOnBeforeInput.js b/src/component/handlers/edit/editOnBeforeInput.js index 04eceea636..2cb795833d 100644 --- a/src/component/handlers/edit/editOnBeforeInput.js +++ b/src/component/handlers/edit/editOnBeforeInput.js @@ -75,7 +75,7 @@ function replaceText( * preserve spellcheck highlighting, which disappears or flashes if re-render * occurs on the relevant text nodes. */ -function editOnBeforeInput(editor: DraftEditor, e: SyntheticInputEvent): void { +function editOnBeforeInput(editor: DraftEditor, e: SyntheticInputEvent<>): void { if (editor._pendingStateFromBeforeInput !== undefined) { editor.update(editor._pendingStateFromBeforeInput); editor._pendingStateFromBeforeInput = undefined; diff --git a/src/component/utils/getDefaultKeyBinding.js b/src/component/utils/getDefaultKeyBinding.js index 47d24c9440..70e5879993 100644 --- a/src/component/utils/getDefaultKeyBinding.js +++ b/src/component/utils/getDefaultKeyBinding.js @@ -32,7 +32,7 @@ var { isCtrlKeyCommand, } = KeyBindingUtil; -function shouldRemoveWord(e: SyntheticKeyboardEvent): boolean { +function shouldRemoveWord(e: SyntheticKeyboardEvent<>): boolean { return (isOSX && e.altKey) || isCtrlKeyCommand(e); } @@ -40,7 +40,7 @@ function shouldRemoveWord(e: SyntheticKeyboardEvent): boolean { * Get the appropriate undo/redo command for a Z key command. */ function getZCommand( - e: SyntheticKeyboardEvent, + e: SyntheticKeyboardEvent<>, ): ?DraftEditorCommand { if (!hasCommandModifier(e)) { return null; @@ -49,7 +49,7 @@ function getZCommand( } function getDeleteCommand( - e: SyntheticKeyboardEvent, + e: SyntheticKeyboardEvent<>, ): ?DraftEditorCommand { // Allow default "cut" behavior for Windows on Shift + Delete. if (isWindows && e.shiftKey) { @@ -59,7 +59,7 @@ function getDeleteCommand( } function getBackspaceCommand( - e: SyntheticKeyboardEvent, + e: SyntheticKeyboardEvent<>, ): ?DraftEditorCommand { if (hasCommandModifier(e) && isOSX) { return 'backspace-to-start-of-line'; @@ -71,7 +71,7 @@ function getBackspaceCommand( * Retrieve a bound key command for the given event. */ function getDefaultKeyBinding( - e: SyntheticKeyboardEvent, + e: SyntheticKeyboardEvent<>, ): ?DraftEditorCommand { switch (e.keyCode) { case 66: // B