mirror of
https://github.com/apache/superset.git
synced 2026-06-05 23:59:25 +00:00
Search queries when enter is pressed (#6043)
* Search queries when enter is pressed * Add unit test * Remove line * Improve test
This commit is contained in:
@@ -41,6 +41,7 @@ class QuerySearch extends React.PureComponent {
|
||||
this.dbMutator = this.dbMutator.bind(this);
|
||||
this.onChange = this.onChange.bind(this);
|
||||
this.changeSearch = this.changeSearch.bind(this);
|
||||
this.onKeyDown = this.onKeyDown.bind(this);
|
||||
this.changeFrom = this.changeFrom.bind(this);
|
||||
this.changeTo = this.changeTo.bind(this);
|
||||
this.changeStatus = this.changeStatus.bind(this);
|
||||
@@ -65,6 +66,11 @@ class QuerySearch extends React.PureComponent {
|
||||
const val = db ? db.value : null;
|
||||
this.setState({ databaseId: val });
|
||||
}
|
||||
onKeyDown(event) {
|
||||
if (event.keyCode === 13) {
|
||||
this.refreshQueries();
|
||||
}
|
||||
}
|
||||
getTimeFromSelection(selection) {
|
||||
switch (selection) {
|
||||
case 'now':
|
||||
@@ -173,6 +179,7 @@ class QuerySearch extends React.PureComponent {
|
||||
<input
|
||||
type="text"
|
||||
onChange={this.changeSearch}
|
||||
onKeyDown={this.onKeyDown}
|
||||
className="form-control input-sm"
|
||||
placeholder={t('Search Results')}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user