From 8473e411cec7b4ec64029723b8df2084c1dbcb00 Mon Sep 17 00:00:00 2001 From: Kevin Chavez Date: Fri, 30 Aug 2019 15:40:14 -0700 Subject: [PATCH] Flowify editOnKeyDown.js Summary: Only logic change was a sketchy null. Slowly making my way flowifying draft.js Reviewed By: gkz Differential Revision: D16595681 fbshipit-source-id: a55e329e31df9a1bf485a263e0096634be656302 --- src/component/handlers/edit/editOnKeyDown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/component/handlers/edit/editOnKeyDown.js b/src/component/handlers/edit/editOnKeyDown.js index 8e9f485862..aad8b701ac 100644 --- a/src/component/handlers/edit/editOnKeyDown.js +++ b/src/component/handlers/edit/editOnKeyDown.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. * * @format - * @flow + * @flow strict-local * @emails oncall+draft_js */ @@ -155,7 +155,7 @@ function editOnKeyDown(editor: DraftEditor, e: SyntheticKeyboardEvent<>): void { const command = editor.props.keyBindingFn(e); // If no command is specified, allow keydown event to continue. - if (!command) { + if (command == null || command === '') { if (keyCode === Keys.SPACE && isChrome && isOptionKeyCommand(e)) { // The default keydown event has already been prevented in order to stop // Chrome from scrolling. Insert a nbsp into the editor as OSX would for