Fix:Using arrow keys when editing podcast description #1826

This commit is contained in:
advplyr 2023-06-07 11:01:11 -05:00
parent fde07d26e5
commit d714ef37d9
2 changed files with 6 additions and 4 deletions

View File

@ -213,7 +213,9 @@ export default {
// Reload HTML content
this.$refs.trix.editor.loadHTML(newContent)
// Move cursor to end of new content updated
this.$refs.trix.editor.setSelectedRange(this.getContentEndPosition())
if (this.autofocus) {
this.$refs.trix.editor.setSelectedRange(this.getContentEndPosition())
}
},
getContentEndPosition() {
return this.$refs.trix.editor.getDocument().toString().length - 1

View File

@ -491,9 +491,9 @@ export default {
}
},
checkActiveElementIsInput() {
var activeElement = document.activeElement
var inputs = ['input', 'select', 'button', 'textarea']
return activeElement && inputs.indexOf(activeElement.tagName.toLowerCase()) !== -1
const activeElement = document.activeElement
const inputs = ['input', 'select', 'button', 'textarea', 'trix-editor']
return activeElement && inputs.some((i) => i === activeElement.tagName.toLowerCase())
},
getHotkeyName(e) {
var keyCode = e.keyCode || e.which