Skip to content

Commit 3b6dd81

Browse files
authored
Merge pull request #11806 from nextcloud/fix/11803/broken-focus
fix(NewMessage): fix broken caret
2 parents 9ae8a99 + 3c56ef6 commit 3b6dd81

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/components/NewMessage/NewMessage.vue

+5-11
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@
104104
@shortkey="focusInput"
105105
@keydown.esc="handleInputEsc"
106106
@keydown.ctrl.up="handleEditLastMessage"
107-
@tribute-active-true.native="isTributePickerActive = true"
108-
@tribute-active-false.native="isTributePickerActive = false"
109107
@input="handleTyping"
110108
@paste="handlePastedFiles"
111109
@submit="handleSubmit" />
@@ -335,7 +333,6 @@ export default {
335333
showPollEditor: false,
336334
showNewFileDialog: -1,
337335
showFilePicker: false,
338-
isTributePickerActive: false,
339336
// Check empty template by default
340337
userData: {},
341338
clipboardTimeStamp: null,
@@ -525,7 +522,7 @@ export default {
525522
},
526523

527524
chatInput(newValue) {
528-
if (this.text !== newValue) {
525+
if (parseSpecialSymbols(this.text) !== newValue) {
529526
this.text = newValue
530527
}
531528
},
@@ -623,6 +620,8 @@ export default {
623620
return
624621
}
625622
this.$nextTick(() => {
623+
// reset or fill main input in chat view from the store
624+
this.text = this.chatInput
626625
// refocus input as the user might want to type further
627626
this.focusInput()
628627
})
@@ -959,17 +958,12 @@ export default {
959958
},
960959

961960
handleInputEsc() {
962-
if (this.messageToEdit && !this.isTributePickerActive) {
961+
if (this.messageToEdit) {
963962
this.handleAbortEdit()
964963
this.focusInput()
965964
return
966965
}
967-
// When the tribute picker (e.g. emoji picker or mentions) is open
968-
// ESC should only close the picker but not blur
969-
if (!this.isTributePickerActive) {
970-
this.blurInput()
971-
}
972-
966+
this.blurInput()
973967
},
974968

975969
handleEditLastMessage() {

0 commit comments

Comments
 (0)