125125 <label class =" label" >Show:</label >
126126 <div class =" control" >
127127 <div class =" select" >
128- <select v-model =" cveListSearchStore.pagination.numberPerPage" aria-label =" Select how many search results to show" >
128+ <select v-model =" cveListSearchStore.pagination.numberPerPage"
129+ aria-label =" Select how many search results to show"
130+ @input =" numberPerPageChange" >
129131 <option v-for =" num in cveListSearchStore.pagination.numberPerPageOptions" :key =" `page-${num}`" :value =" num" >
130132 {{ num }}
131133 </option >
135137 <label for =" sort" class =" label" >Sort by:</label >
136138 <div class =" control" >
137139 <div class =" select" >
138- <select name =" partner" v-model =" cveListSearchStore.pagination.sortBy" aria-label =" Select a sort option" >
140+ <select name =" partner" v-model =" cveListSearchStore.pagination.sortBy"
141+ aria-label =" Select a sort option"
142+ @input =" sortByChange" >
139143 <option v-for =" sort in cveListSearchStore.pagination.sortByOptions" :key =" sort.key"
140144 :value =" sort"
141145 >
@@ -286,14 +290,6 @@ const app = createApp({});
286290
287291app .component (' ServiceUnavailable' , ServiceUnavailable);
288292
289- watch (()=> cveListSearchStore .pagination .numberPerPage , ()=> {
290- if (! cveListSearchStore .isSearching ) cveListSearchStore .handleNumberPerPageChange ();
291- }, { deep: true });
292-
293- watch (()=> cveListSearchStore .pagination .sortBy , ()=> {
294- if (! cveListSearchStore .isSearching ) cveListSearchStore .sortResults ();
295- }, { deep: true });
296-
297293function backToTop () {
298294 router .push ({
299295 name: ' SearchResults' ,
@@ -311,6 +307,16 @@ function cveRecordRoute(cveId) {
311307 return recordRoute
312308}
313309
310+ function numberPerPageChange () {
311+ if (! cveListSearchStore .isSearching )
312+ cveListSearchStore .handleNumberPerPageChange ();
313+ }
314+
315+ function sortByChange () {
316+ if (! cveListSearchStore .isSearching )
317+ cveListSearchStore .sortResults ();
318+ }
319+
314320const websiteEnv = computed (() => {
315321 return import .meta.env.VITE_WEBSITE_ENVIRONMENT;
316322});
0 commit comments