From ebcd05731f77c34a07f0a210b136bed37f0ac014 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 10 Jan 2018 10:06:01 -0800 Subject: [PATCH] support 'code' in hasSelectionInBlock (see react-draft-wysiwyg) --- lib/hasSelectionInBlock.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hasSelectionInBlock.js b/lib/hasSelectionInBlock.js index cb12da6..cda6296 100644 --- a/lib/hasSelectionInBlock.js +++ b/lib/hasSelectionInBlock.js @@ -10,7 +10,7 @@ function hasSelectionInBlock(editorState) { var startKey = selection.getStartKey(); var currentBlock = contentState.getBlockForKey(startKey); - return currentBlock.getType() === 'code-block'; + return ~['code-block', 'code'].indexOf(currentBlock.getType()); } module.exports = hasSelectionInBlock;