Skip to content

Commit

Permalink
Add parameter dialog doesn't work when query has selected text (#4032)
Browse files Browse the repository at this point in the history
* debounce updateQuery to prevent pasting parameters over selected texts failing parseQuery (see #4032)

* drop defer
  • Loading branch information
Omer Lachish authored Aug 14, 2019
1 parent 69ba165 commit f7c70c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/app/pages/queries/source-view.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { map, defer } from 'lodash';
import { map, debounce } from 'lodash';
import template from './query.html';
import EditParameterSettingsDialog from '@/components/EditParameterSettingsDialog';

Expand Down Expand Up @@ -52,7 +52,11 @@ function QuerySourceCtrl(

$scope.canForkQuery = () => currentUser.hasPermission('edit_query') && !$scope.dataSource.view_only;

$scope.updateQuery = newQueryText => defer(() => $scope.$apply(() => { $scope.query.query = newQueryText; }));
$scope.updateQuery = debounce(
newQueryText => $scope.$apply(() => {
$scope.query.query = newQueryText;
}),
);

// @override
$scope.saveQuery = (options, data) => {
Expand Down

0 comments on commit f7c70c2

Please sign in to comment.