Преглед на файлове

Enable search also after editing

David Kaltschmidt преди 7 години
родител
ревизия
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) => {
-    const firstModified = this.modifiedQuery === undefined;
+    const enableSearchField = !this.modifiedQuery && value;
     this.modifiedQuery = value;
     // Send text change to parent
     const { initialQuery, onQueryChange } = this.props;
@@ -154,7 +154,7 @@ class LokiQueryField extends React.PureComponent<LokiQueryFieldProps, LokiQueryF
       onQueryChange(query, override);
     }
     // Enable the search field if we have a selector query
-    if (firstModified) {
+    if (enableSearchField) {
       this.forceUpdate();
     }
   };