Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions src/components/NewMessage/NewMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@
@shortkey="focusInput"
@keydown.esc="handleInputEsc"
@keydown.ctrl.up="handleEditLastMessage"
@tribute-active-true.native="isTributePickerActive = true"
@tribute-active-false.native="isTributePickerActive = false"
@input="handleTyping"
@paste="handlePastedFiles"
@submit="handleSubmit" />
Expand Down Expand Up @@ -335,7 +333,6 @@ export default {
showPollEditor: false,
showNewFileDialog: -1,
showFilePicker: false,
isTributePickerActive: false,
// Check empty template by default
userData: {},
clipboardTimeStamp: null,
Expand Down Expand Up @@ -526,7 +523,7 @@ export default {
},

chatInput(newValue) {
if (this.text !== newValue) {
if (parseSpecialSymbols(this.text) !== newValue) {
this.text = newValue
}
},
Expand Down Expand Up @@ -624,6 +621,8 @@ export default {
return
}
this.$nextTick(() => {
// reset or fill main input in chat view from the store
this.text = this.chatInput
// refocus input as the user might want to type further
this.focusInput()
})
Expand Down Expand Up @@ -960,17 +959,12 @@ export default {
},

handleInputEsc() {
if (this.messageToEdit && !this.isTributePickerActive) {
if (this.messageToEdit) {
this.handleAbortEdit()
this.focusInput()
return
}
// When the tribute picker (e.g. emoji picker or mentions) is open
// ESC should only close the picker but not blur
if (!this.isTributePickerActive) {
this.blurInput()
}

this.blurInput()
},

handleEditLastMessage() {
Expand Down