Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more RTE fixes
  • Loading branch information
aviraldg committed Jun 14, 2016
1 parent 8cb086e commit ba69e43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/RichText.js
Expand Up @@ -141,7 +141,8 @@ export function modifyText(contentState: ContentState, rangeToReplace: Selection
for(let currentKey = startKey;
currentKey && currentKey !== endKey;
currentKey = contentState.getKeyAfter(currentKey)) {
text += getText(currentKey).substring(startOffset, blockText.length);
let blockText = getText(currentKey);
text += blockText.substring(startOffset, blockText.length);

// from now on, we'll take whole blocks
startOffset = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/MessageComposerInput.js
Expand Up @@ -199,7 +199,7 @@ export default class MessageComposerInput extends React.Component {
if (contentJSON) {
let content = convertFromRaw(JSON.parse(contentJSON));
component.setState({
editorState: component.createEditorState(this.state.isRichtextEnabled, content)
editorState: component.createEditorState(component.state.isRichtextEnabled, content)
});
}
}
Expand Down

0 comments on commit ba69e43

Please sign in to comment.