Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to abort emoji and user autocompletion #8870

Merged
merged 2 commits into from Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/components/NewMessageForm/NewMessageForm.vue
Expand Up @@ -123,7 +123,9 @@
:placeholder="placeholderText"
:aria-label="placeholderText"
@shortkey="focusInput"
@keydown.esc.prevent="blurInput"
@keydown.esc.prevent="handleInputEsc"
@tribute-active-true.native="isTributePickerActive = true"
@tribute-active-false.native="isTributePickerActive = false"
@paste="handlePastedFiles"
@submit="handleSubmit({ silent: false })" />
</div>
Expand Down Expand Up @@ -329,7 +331,7 @@ export default {
showTextFileDialog: false,
textFileTitle: t('spreed', 'New file'),
newFileError: '',

isTributePickerActive: false,
// Check empty template by default
checked: -1,
userData: {},
Expand Down Expand Up @@ -886,6 +888,14 @@ export default {
blurInput() {
document.activeElement.blur()
},

handleInputEsc() {
// 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()
}
}
},
}
</script>
Expand Down