Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
3b0a04c6
Commit
3b0a04c6
authored
Feb 05, 2019
by
Hugo Häggmark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed so onBlur event trigger an QueryChange and QueryExecute if values differ
parent
2c255fd8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
public/app/features/explore/QueryField.tsx
+12
-1
No files found.
public/app/features/explore/QueryField.tsx
View file @
3b0a04c6
...
...
@@ -50,6 +50,7 @@ export interface QueryFieldState {
typeaheadPrefix
:
string
;
typeaheadText
:
string
;
value
:
Value
;
lastExecutedValue
:
Value
;
}
export
interface
TypeaheadInput
{
...
...
@@ -89,6 +90,7 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS
typeaheadPrefix
:
''
,
typeaheadText
:
''
,
value
:
makeValue
(
this
.
placeholdersBuffer
.
toString
(),
props
.
syntax
),
lastExecutedValue
:
null
,
};
}
...
...
@@ -167,6 +169,7 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS
if
(
onExecuteQuery
)
{
onExecuteQuery
();
this
.
setState
({
lastExecutedValue
:
this
.
state
.
value
});
}
};
...
...
@@ -381,12 +384,20 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS
}
};
handleBlur
=
()
=>
{
handleBlur
=
(
event
,
change
)
=>
{
const
{
lastExecutedValue
}
=
this
.
state
;
const
previousValue
=
lastExecutedValue
?
Plain
.
serialize
(
this
.
state
.
lastExecutedValue
)
:
null
;
const
currentValue
=
Plain
.
serialize
(
change
.
value
);
// If we dont wait here, menu clicks wont work because the menu
// will be gone.
this
.
resetTimer
=
setTimeout
(
this
.
resetTypeahead
,
100
);
// Disrupting placeholder entry wipes all remaining placeholders needing input
this
.
placeholdersBuffer
.
clearPlaceholders
();
if
(
previousValue
!==
currentValue
)
{
this
.
executeOnQueryChangeAndExecuteQueries
();
}
};
handleFocus
=
()
=>
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment