fix comments being set backwards (#2076)
This commit is contained in:
parent
e6b286f056
commit
33407e7dd9
1 changed files with 3 additions and 4 deletions
|
@ -47,13 +47,12 @@ const MarkdownEditorInput = (props: Props): ReactElement => {
|
|||
, [workspaceUsers])
|
||||
const ref = useRef<Editor>(null)
|
||||
|
||||
const generateEditorState = (text?: string) => {
|
||||
const state = EditorState.createWithContent(ContentState.createFromText(text || ''))
|
||||
return EditorState.moveSelectionToEnd(state)
|
||||
const generateEditorState = (text?: string): EditorState => {
|
||||
return EditorState.createWithContent(ContentState.createFromText(text || ''))
|
||||
}
|
||||
|
||||
const [editorState, setEditorState] = useState(() => {
|
||||
return generateEditorState(initialText)
|
||||
return EditorState.moveSelectionToEnd(generateEditorState(initialText))
|
||||
})
|
||||
|
||||
// avoiding stale closure
|
||||
|
|
Loading…
Reference in a new issue