diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js index 03476207b..a809140b0 100644 --- a/src/boot/qformMixin.js +++ b/src/boot/qformMixin.js @@ -24,26 +24,24 @@ export default { firstInputElement.focus(); } const that = this; - for (const availableInput of availableInputs) { - availableInput.addEventListener('keydown', (evt) => { - if (evt.key === 'Enter') { - const input = evt.target; - console.log('input', input); - if (input.type == 'textarea' && evt.shiftKey) { - evt.preventDefault(); - let { selectionStart, selectionEnd } = input; - input.value = - input.value.substring(0, selectionStart) + - '\n' + - input.value.substring(selectionEnd); - selectionStart = selectionEnd = selectionStart + 1; - return; - } + this.$el.addEventListener('keyup', function (evt) { + if (evt.key === 'Enter') { + const input = evt.target; + console.log('input', input); + if (input.type == 'textarea' && evt.shiftKey) { evt.preventDefault(); - that.onSubmit(); + let { selectionStart, selectionEnd } = input; + input.value = + input.value.substring(0, selectionStart) + + '\n' + + input.value.substring(selectionEnd); + selectionStart = selectionEnd = selectionStart + 1; + return; } - }); - } + evt.preventDefault(); + that.onSubmit(); + } + }); } } }, diff --git a/src/components/EditPictureForm.vue b/src/components/EditPictureForm.vue index 4adfa37ea..8a22debda 100644 --- a/src/components/EditPictureForm.vue +++ b/src/components/EditPictureForm.vue @@ -155,7 +155,7 @@ const rotateRight = () => { editor.value.rotate(-90); }; -const onUploadAccept = () => { +const onSubmit = () => { try { if (!newPhoto.files && !newPhoto.url) { notify(t('Select an image'), 'negative'); @@ -206,11 +206,7 @@ const makeRequest = async () => { @on-fetch="(data) => (allowedContentTypes = data.join(', '))" auto-load /> - +