Skip to content

Commit 80abb64

Browse files
authored
Merge pull request #2 from sugarshin/patch-1
Fix ContentBlock data type
2 parents 4c8e528 + 44ab83d commit 80abb64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/modifiers/insertEmptyBlock.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { genKey, ContentBlock, EditorState } from 'draft-js';
2-
import { List } from 'immutable';
2+
import { List, Map } from 'immutable';
33

44
const insertEmptyBlock = (editorState, blockType = 'unstyled', data = {}) => {
55
const contentState = editorState.getCurrentContent();
@@ -13,7 +13,7 @@ const insertEmptyBlock = (editorState, blockType = 'unstyled', data = {}) => {
1313
key: emptyBlockKey,
1414
text: '',
1515
type: blockType,
16-
data
16+
data: Map().merge(data)
1717
});
1818
const blockMap = contentState.getBlockMap();
1919
const blocksBefore = blockMap.toSeq().takeUntil((value) => value === currentBlock);

0 commit comments

Comments
 (0)