Skip to content

Commit 0924164

Browse files
fix search function from executing after invalid input and fix import
1 parent f2560e6 commit 0924164

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/components/PrimaryNavigation.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
</template>
151151

152152
<script>
153-
import cveRecordSearch from './cveRecordSearchModule.vue';
153+
import cveRecordSearch from '@/components/cveRecordSearchModule.vue';
154154
155155
export default {
156156
components: { cveRecordSearch },

src/components/cveRecordSearchModule.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
placeholder="Enter keywords (e.g.: CVE ID, sql injection, etc.)"/>
77
</div>
88
<div class="control">
9-
<button @click="startSearch"
9+
<button @click="validate"
1010
class="button cve-button cve-button-accent-warm"
1111
:class="{'is-loading': cveListSearchStore.isSearching, 'disabled': cveListSearchStore.isSeachButtonDisabled}"
1212
:aria-disabled="cveListSearchStore.isSeachButtonDisabled">
@@ -46,7 +46,7 @@ watch(
4646
if (route.query?.query){
4747
queryString.value = route.query.query.trim();
4848
validateQueryString();
49-
if (!cveListSearchStore.showHelpText) {
49+
if (!cveListSearchStore.isSeachButtonDisabled) {
5050
startSearch();
5151
}
5252
} else {
@@ -87,7 +87,14 @@ function validateQueryString() {
8787
}
8888
8989
function onKeyUpEnter() {
90+
validate()
91+
}
92+
93+
function validate() {
94+
console.log('>>>>> validate')
95+
validateQueryString();
9096
if (!cveListSearchStore.isSeachButtonDisabled) {
97+
console.log('>>>>> startsearch')
9198
startSearch();
9299
}
93100
}

0 commit comments

Comments
 (0)