Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Flowify editOnKeyDown.js
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mrkev authored and facebook-github-bot committed Aug 30, 2019
1 parent 2c61167 commit 8473e41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/component/handlers/edit/editOnKeyDown.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
* @flow strict-local
* @emails oncall+draft_js
*/

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8473e41

Please sign in to comment.