mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-03 20:36:57 +03:00
WIP to prevent RTE from deleting current message input when up arrow pressed
This commit is contained in:
parent
be60dfdc3a
commit
1523d304f2
1 changed files with 2 additions and 2 deletions
|
@ -560,7 +560,7 @@ export default class MessageComposerInput extends React.Component {
|
||||||
|
|
||||||
onUpArrow = async (e) => {
|
onUpArrow = async (e) => {
|
||||||
const completion = this.autocomplete.onUpArrow();
|
const completion = this.autocomplete.onUpArrow();
|
||||||
if (completion == null) {
|
if (completion == null && !(this.historyManager.currentIndex === -1 && this.state.editorState.getCurrentContent().hasText())) {
|
||||||
const newContent = this.historyManager.getItem(-1, this.state.isRichtextEnabled ? 'html' : 'markdown');
|
const newContent = this.historyManager.getItem(-1, this.state.isRichtextEnabled ? 'html' : 'markdown');
|
||||||
if (!newContent) return false;
|
if (!newContent) return false;
|
||||||
const editorState = EditorState.push(this.state.editorState,
|
const editorState = EditorState.push(this.state.editorState,
|
||||||
|
@ -575,7 +575,7 @@ export default class MessageComposerInput extends React.Component {
|
||||||
|
|
||||||
onDownArrow = async (e) => {
|
onDownArrow = async (e) => {
|
||||||
const completion = this.autocomplete.onDownArrow();
|
const completion = this.autocomplete.onDownArrow();
|
||||||
if (completion == null) {
|
if (completion == null && !(this.historyManager.currentIndex === -1 && this.state.editorState.getCurrentContent().hasText())) {
|
||||||
const newContent = this.historyManager.getItem(+1, this.state.isRichtextEnabled ? 'html' : 'markdown');
|
const newContent = this.historyManager.getItem(+1, this.state.isRichtextEnabled ? 'html' : 'markdown');
|
||||||
if (!newContent) return false;
|
if (!newContent) return false;
|
||||||
const editorState = EditorState.push(this.state.editorState,
|
const editorState = EditorState.push(this.state.editorState,
|
||||||
|
|
Loading…
Reference in a new issue