From 15f96fcfceecfcbbde4c7667f881d3efa46bb95f Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Wed, 28 Mar 2018 14:17:36 +0800 Subject: [PATCH] fix: add missing hotkey for delete word backward, close: #1709 (#1729) --- packages/slate-react/src/constants/hotkeys.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/slate-react/src/constants/hotkeys.js b/packages/slate-react/src/constants/hotkeys.js index 608b2a2da..9ada2c34a 100644 --- a/packages/slate-react/src/constants/hotkeys.js +++ b/packages/slate-react/src/constants/hotkeys.js @@ -42,9 +42,11 @@ const DELETE_LINE_FORWARD_MAC = isKeyHotkey('ctrl+k') const DELETE_LINE_BACKWARD = e => IS_APPLE && DELETE_LINE_BACKWARD_MAC(e) const DELETE_LINE_FORWARD = e => IS_APPLE && DELETE_LINE_FORWARD_MAC(e) -const DELETE_WORD_BACKWARD_MAC = isKeyHotkey('option+backspace') +const DELETE_WORD_BACKWARD_MAC = e => + isKeyHotkey('shift+option+backspace', e) || isKeyHotkey('option+backspace', e) const DELETE_WORD_BACKWARD_PC = isKeyHotkey('ctrl+backspace') -const DELETE_WORD_FORWARD_MAC = isKeyHotkey('option+delete') +const DELETE_WORD_FORWARD_MAC = e => + isKeyHotkey('shift+option+delete', e) || isKeyHotkey('option+delete', e) const DELETE_WORD_FORWARD_PC = isKeyHotkey('ctrl+delete') const DELETE_WORD_BACKWARD = e => IS_APPLE ? DELETE_WORD_BACKWARD_MAC(e) : DELETE_WORD_BACKWARD_PC(e)