Restore composer focus after event edit (#7065)

This commit is contained in:
Germain 2021-11-02 09:59:30 +00:00 committed by GitHub
parent 57fae01991
commit 4cbef216e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -207,7 +207,10 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
event: null, event: null,
timelineRenderingType: this.context.timelineRenderingType, timelineRenderingType: this.context.timelineRenderingType,
}); });
dis.fire(Action.FocusSendMessageComposer); dis.dispatch({
action: Action.FocusSendMessageComposer,
context: this.context.timelineRenderingType,
});
} }
event.preventDefault(); event.preventDefault();
break; break;
@ -237,7 +240,10 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
event: null, event: null,
timelineRenderingType: this.context.timelineRenderingType, timelineRenderingType: this.context.timelineRenderingType,
}); });
dis.fire(Action.FocusSendMessageComposer); dis.dispatch({
action: Action.FocusSendMessageComposer,
context: this.context.timelineRenderingType,
});
}; };
private get shouldSaveStoredEditorState(): boolean { private get shouldSaveStoredEditorState(): boolean {
@ -431,7 +437,10 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
event: null, event: null,
timelineRenderingType: this.context.timelineRenderingType, timelineRenderingType: this.context.timelineRenderingType,
}); });
dis.fire(Action.FocusSendMessageComposer); dis.dispatch({
action: Action.FocusSendMessageComposer,
context: this.context.timelineRenderingType,
});
}; };
private cancelPreviousPendingEdit(): void { private cancelPreviousPendingEdit(): void {