Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Fix cursor behavior for soft new lines
Browse files Browse the repository at this point in the history
Summary:Forcing a selection will cause the browser to behave properly and show the cursor for multiple new lines.
Closes #255

Reviewed By: spicyj

Differential Revision: D3132587

fb-gh-sync-id: 93d94cfae96e7233b573623cd8076fa212a87182
fbshipit-source-id: 93d94cfae96e7233b573623cd8076fa212a87182
  • Loading branch information
johanneslumpe authored and Facebook Github Bot 4 committed Apr 5, 2016
1 parent 8ac9cf3 commit 75908ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/model/modifier/RichTextEditorUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,16 @@ var RichTextEditorUtil = {
null
);

return EditorState.push(
var newEditorState = EditorState.push(
editorState,
contentState,
'insert-characters'
);

return EditorState.forceSelection(
newEditorState,
contentState.getSelectionAfter()
);
},

/**
Expand Down

0 comments on commit 75908ad

Please sign in to comment.