Sfoglia il codice sorgente

HUE-6815 [frontend] Clear the inline autocomplete when focus is lost

Johan Ahlen 8 anni fa
parent
commit
1563db5
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      desktop/core/src/desktop/templates/ko_components.mako

+ 8 - 0
desktop/core/src/desktop/templates/ko_components.mako

@@ -635,6 +635,14 @@ from desktop.views import _ko
           }
         });
 
+        self.searchHasFocus.subscribe(function (newVal) {
+          if (!newVal) {
+            self.inlineAutocomplete('');
+          } else if (self.searchInput() !== '') {
+            self.triggerAutocomplete(self.searchInput());
+          }
+        });
+
         self.searchResultVisible.subscribe(function (newVal) {
           if (!newVal) {
             self.selectedIndex(undefined);