Просмотр исходного кода

Enable search also after editing

David Kaltschmidt 7 лет назад
Родитель
Сommit
9293ff06cd
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      public/app/plugins/datasource/loki/components/LokiQueryField.tsx

+ 2 - 2
public/app/plugins/datasource/loki/components/LokiQueryField.tsx

@@ -140,7 +140,7 @@ class LokiQueryField extends React.PureComponent<LokiQueryFieldProps, LokiQueryF
   };
   };
 
 
   onChangeQuery = (value: string, override?: boolean) => {
   onChangeQuery = (value: string, override?: boolean) => {
-    const firstModified = this.modifiedQuery === undefined;
+    const enableSearchField = !this.modifiedQuery && value;
     this.modifiedQuery = value;
     this.modifiedQuery = value;
     // Send text change to parent
     // Send text change to parent
     const { initialQuery, onQueryChange } = this.props;
     const { initialQuery, onQueryChange } = this.props;
@@ -154,7 +154,7 @@ class LokiQueryField extends React.PureComponent<LokiQueryFieldProps, LokiQueryF
       onQueryChange(query, override);
       onQueryChange(query, override);
     }
     }
     // Enable the search field if we have a selector query
     // Enable the search field if we have a selector query
-    if (firstModified) {
+    if (enableSearchField) {
       this.forceUpdate();
       this.forceUpdate();
     }
     }
   };
   };