From 3c2cd1c17ea8c2bfa38687b8378815aea13a4e82 Mon Sep 17 00:00:00 2001 From: PaulDremanovich Date: Wed, 22 May 2024 12:37:56 +0400 Subject: [PATCH] fix: unable to move up/down cursor in a multiline message --- src/components/AChat/AChatForm.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/AChat/AChatForm.vue b/src/components/AChat/AChatForm.vue index 740354c64..80e146bdd 100644 --- a/src/components/AChat/AChatForm.vue +++ b/src/components/AChat/AChatForm.vue @@ -161,8 +161,7 @@ export default { if (event.ctrlKey && event.shiftKey && event.code === 'Digit1') { this.openElement() } else if (this.isInputFocused && (event.code === 'ArrowUp' || event.code === 'ArrowDown')) { - this.selectCommand(event.code) - event.preventDefault() + this.selectCommand(event) } else if (event.key.length === 1) { this.botCommandSelectionMode = false this.botCommandIndex = null @@ -254,13 +253,15 @@ export default { focus() { this.$refs.messageTextarea.focus() }, - selectCommand(direction) { + selectCommand(event) { + const direction = event.code if (!this.message) { this.botCommandSelectionMode = true } if (!this.botCommandSelectionMode) { return } + event.preventDefault() const commands = this.$store.getters['botCommands/getCommandsHistory'](this.partnerId) const maxIndex = commands.length > 0 ? commands.length - 1 : 0 if (this.botCommandIndex === null) {