draft-js-modifiers
Version:
Modular state modifiers for Draft.js
14 lines (10 loc) • 472 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _draftJs = require('draft-js');
var mergeEntityData = function mergeEntityData(editorState, entityKey, data) {
var newContentState = editorState.getCurrentContent().mergeEntityData(entityKey, data);
return _draftJs.EditorState.forceSelection(_draftJs.EditorState.push(editorState, newContentState, 'apply-entity'), editorState.getSelection());
};
exports.default = mergeEntityData;