From cefc75a4edd7935f73d40a54816918d658471aaa Mon Sep 17 00:00:00 2001 From: advplyr Date: Tue, 31 Jan 2023 16:04:30 -0600 Subject: [PATCH] Fix:Edit library modal blur inputs on submit #1427 --- .../modals/libraries/EditLibrary.vue | 19 ++++++++++++++++--- .../components/modals/libraries/EditModal.vue | 4 ++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/client/components/modals/libraries/EditLibrary.vue b/client/components/modals/libraries/EditLibrary.vue index 438926d5..83f37ab7 100644 --- a/client/components/modals/libraries/EditLibrary.vue +++ b/client/components/modals/libraries/EditLibrary.vue @@ -6,7 +6,7 @@
- +
@@ -20,12 +20,12 @@

{{ $strings.LabelFolders }}

folder - + close
folder - +
{{ $strings.ButtonBrowseForFolder }} @@ -82,6 +82,19 @@ export default { } }, methods: { + checkBlurExpressionInput() { + if (this.$refs.nameInput) { + this.$refs.nameInput.blur() + } + if (this.$refs.folderInput && this.$refs.folderInput.length) { + this.$refs.folderInput.forEach((input) => { + if (input.blur) input.blur() + }) + } + if (this.$refs.newFolderInput) { + this.$refs.newFolderInput.blur() + } + }, browseForFolder() { this.showDirectoryPicker = true }, diff --git a/client/components/modals/libraries/EditModal.vue b/client/components/modals/libraries/EditModal.vue index c90d3050..f83ebf74 100644 --- a/client/components/modals/libraries/EditModal.vue +++ b/client/components/modals/libraries/EditModal.vue @@ -144,8 +144,6 @@ export default { return true }, submit() { - if (!this.validate()) return - // If custom expression input is focused then unfocus it instead of submitting if (this.$refs.tabComponent && this.$refs.tabComponent.checkBlurExpressionInput) { if (this.$refs.tabComponent.checkBlurExpressionInput()) { @@ -153,6 +151,8 @@ export default { } } + if (!this.validate()) return + if (this.library) { this.submitUpdateLibrary() } else {