Sfoglia il codice sorgente

fix: datasource search was not working properly

Torkel Ödegaard 7 anni fa
parent
commit
a4587cdeee
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      public/app/features/plugins/ds_list_ctrl.ts

+ 1 - 0
public/app/features/plugins/ds_list_ctrl.ts

@@ -19,6 +19,7 @@ export class DataSourcesCtrl {
   onQueryUpdated() {
     let regex = new RegExp(this.searchQuery, 'ig');
     this.datasources = _.filter(this.unfiltered, item => {
+      regex.lastIndex = 0;
       return regex.test(item.name) || regex.test(item.type);
     });
   }