From 7c081fe5591042c9193cd2c5d7e36cf00d0061e8 Mon Sep 17 00:00:00 2001 From: Brooks Lyrette Date: Mon, 28 Mar 2016 21:40:01 -0400 Subject: [PATCH] Limiting this to only Chrome. --- src/component/handlers/edit/editOnKeyDown.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/component/handlers/edit/editOnKeyDown.js b/src/component/handlers/edit/editOnKeyDown.js index c51fe014ad..bbeee5c743 100644 --- a/src/component/handlers/edit/editOnKeyDown.js +++ b/src/component/handlers/edit/editOnKeyDown.js @@ -17,6 +17,7 @@ var EditorState = require('EditorState'); var KeyBindingUtil = require('KeyBindingUtil'); var Keys = require('Keys'); var SecondaryClipboard = require('SecondaryClipboard'); +var UserAgent = require('UserAgent'); var keyCommandBackspaceToStartOfLine = require('keyCommandBackspaceToStartOfLine'); var keyCommandBackspaceWord = require('keyCommandBackspaceWord'); @@ -32,6 +33,7 @@ var keyCommandUndo = require('keyCommandUndo'); import type {DraftEditorCommand} from 'DraftEditorCommand'; var { isOptionKeyCommand } = KeyBindingUtil; +var isChrome = UserAgent.isBrowser('Chrome'); /** * Map a `DraftEditorCommand` command value to a corresponding function. @@ -107,7 +109,7 @@ function editOnKeyDown(e: SyntheticKeyboardEvent): void { return; case Keys.SPACE: // handling for OSX where option + space scrolls - if (isOptionKeyCommand(e)) { + if (isChrome && isOptionKeyCommand(e)) { e.preventDefault(); // insert a space into the editor const contentState = DraftModifier.replaceText(