From 85ea45fbe9b34d9a19ed1a3fcaed95514c3977e5 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 1 Apr 2023 18:41:20 +0200 Subject: [PATCH] fix: fix invalid name input checks (#1312) --- src/components/panels/GcodefilesPanel.vue | 6 +++--- src/components/panels/Machine/ConfigFilesPanel.vue | 8 ++++---- src/components/panels/Timelapse/TimelapseFilesPanel.vue | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/panels/GcodefilesPanel.vue b/src/components/panels/GcodefilesPanel.vue index aae54289a..f5180ad10 100644 --- a/src/components/panels/GcodefilesPanel.vue +++ b/src/components/panels/GcodefilesPanel.vue @@ -391,7 +391,7 @@ :label="$t('Files.Name')" required :rules="nameInputRules" - @update:error="isInvalidName = !isInvalidName" + @update:error="(bool) => (isInvalidName = bool)" @keypress.enter="createDirectoryAction"> @@ -420,7 +420,7 @@ :label="$t('Files.Name').toString()" required :rules="nameInputRules" - @update:error="isInvalidName = !isInvalidName" + @update:error="(bool) => (isInvalidName = bool)" @keyup.enter="renameFileAction"> @@ -449,7 +449,7 @@ :label="$t('Files.Name')" required :rules="nameInputRules" - @update:error="isInvalidName = !isInvalidName" + @update:error="(bool) => (isInvalidName = bool)" @keyup.enter="renameDirectoryAction"> diff --git a/src/components/panels/Machine/ConfigFilesPanel.vue b/src/components/panels/Machine/ConfigFilesPanel.vue index 8c4cd1820..0d76bfa4c 100644 --- a/src/components/panels/Machine/ConfigFilesPanel.vue +++ b/src/components/panels/Machine/ConfigFilesPanel.vue @@ -278,7 +278,7 @@ :label="$t('Machine.ConfigFilesPanel.Name')" required :rules="nameInputRules" - @update:error="isInvalidName = !isInvalidName" + @update:error="(bool) => (isInvalidName = bool)" @keyup.enter="createFileAction"> @@ -309,7 +309,7 @@ :label="$t('Machine.ConfigFilesPanel.Name')" required :rules="nameInputRules" - @update:error="isInvalidName = !isInvalidName" + @update:error="(bool) => (isInvalidName = bool)" @keyup.enter="renameFileAction"> @@ -340,7 +340,7 @@ :label="$t('Machine.ConfigFilesPanel.Name')" required :rules="nameInputRules" - @update:error="isInvalidName = !isInvalidName" + @update:error="(bool) => (isInvalidName = bool)" @keyup.enter="createDirectoryAction"> @@ -371,7 +371,7 @@ :label="$t('Machine.ConfigFilesPanel.Name')" required :rules="nameInputRules" - @update:error="isInvalidName = !isInvalidName" + @update:error="(bool) => (isInvalidName = bool)" @keyup.enter="renameDirectoryAction"> diff --git a/src/components/panels/Timelapse/TimelapseFilesPanel.vue b/src/components/panels/Timelapse/TimelapseFilesPanel.vue index 41353bbd8..692b53800 100644 --- a/src/components/panels/Timelapse/TimelapseFilesPanel.vue +++ b/src/components/panels/Timelapse/TimelapseFilesPanel.vue @@ -247,7 +247,7 @@ :label="$t('Timelapse.Name')" required :rules="nameInputRules" - @update:error="isInvalidName = !isInvalidName" + @update:error="(bool) => (isInvalidName = bool)" @keypress.enter="renameFileAction"> @@ -276,7 +276,7 @@ :label="$t('Timelapse.Name')" required :rules="nameInputRules" - @update:error="isInvalidName = !isInvalidName" + @update:error="(bool) => (isInvalidName = bool)" @keypress.enter="createDirectoryAction"> @@ -307,7 +307,7 @@ :label="$t('Timelapse.Name')" required :rules="nameInputRules" - @update:error="isInvalidName = !isInvalidName" + @update:error="(bool) => (isInvalidName = bool)" @keyup.enter="renameDirectoryAction">