mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
preserve selection and history between room changes and refreshes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
1c24f1fd5a
commit
cbe5944ff0
1 changed files with 6 additions and 1 deletions
|
@ -32,7 +32,12 @@ class MessageComposerStore {
|
|||
|
||||
setEditorState(roomId: string, editorState: Value, richText: boolean) {
|
||||
localStorage.setItem(this._getKey(roomId), JSON.stringify({
|
||||
editor_state: editorState,
|
||||
editor_state: editorState.toJSON({
|
||||
preserveSelection: true,
|
||||
preserveHistory: true,
|
||||
// XXX: this seems like a workaround for selection.isSet being based on anchorKey instead of anchorPath
|
||||
preserveKeys: true,
|
||||
}),
|
||||
rich_text: richText,
|
||||
}));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue