From 193a6b59425ab45004f4178fc3f5b5bad5b4c660 Mon Sep 17 00:00:00 2001
From: jdlugosz963 <jdlugosz963@gmail.com>
Date: Tue, 14 Dec 2021 06:22:57 +0100
Subject: make group searcher works

---
 src/components/Searcher.vue | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

(limited to 'src/components/Searcher.vue')

diff --git a/src/components/Searcher.vue b/src/components/Searcher.vue
index a1093a2..df6dd9e 100644
--- a/src/components/Searcher.vue
+++ b/src/components/Searcher.vue
@@ -11,9 +11,9 @@
 
     <Sugestion 
       v-for="sugestion in sugestions" 
-      :key="sugestion[0]" 
-      :command="sugestion[1]" 
-      :class="{selected: sugestion[0] === current[0]}" 
+      :key="sugestion[0]"
+      :sugestion="sugestion"
+      :class="{selected: sugestion[0] === current[0]}"
     />
   </div>
 </template>
@@ -64,7 +64,6 @@ export default {
     async execute_current() {
       let out = await this.current[1](this)
 
-      console.log(out)
       if(out instanceof Object) {
         this.search = ''
         this.commands = out
@@ -72,25 +71,29 @@ export default {
     },
 
     hotkeys(e) {
-      e.preventDefault()
-
       switch(e.code) {
         case 'Escape':
-        this.close()
-        break
+          e.preventDefault()
+          this.close()
+          break
         case 'ArrowDown':
+          e.preventDefault()
           this.change_current(1)
           break
         case 'ArrowUp':
+          e.preventDefault()
           this.change_current(-1)
           break
         case 'Tab':
+          e.preventDefault()
           this.change_current(1)
           break
         case 'Enter':
+          e.preventDefault()
           this.execute_current()
           break
         case 'ShiftLeft':
+          e.preventDefault()
           this.commands = CommandsService
           break
       }
-- 
cgit v1.2.3

