瀏覽代碼

fix: datasource search was not working properly

Torkel Ödegaard 7 年之前
父節點
當前提交
a4587cdeee
共有 1 個文件被更改,包括 1 次插入0 次删除
  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);
     });
   }