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
a887c344
Unverified
Commit
a887c344
authored
Apr 09, 2019
by
Hugo Häggmark
Committed by
GitHub
Apr 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Disables auto open datasource picker on focus (#16398)
parent
80a170e6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
public/app/core/components/Select/DataSourcePicker.tsx
+8
-7
public/app/features/dashboard/panel_editor/QueriesTab.tsx
+1
-0
public/app/features/explore/QueryField.tsx
+0
-3
No files found.
public/app/core/components/Select/DataSourcePicker.tsx
View file @
a887c344
// Libraries
import
React
,
{
PureComponent
}
from
'react'
;
import
_
from
'lodash'
;
// Components
import
{
Select
}
from
'@grafana/ui'
;
import
{
Select
,
SelectOptionItem
}
from
'@grafana/ui'
;
// Types
import
{
DataSourceSelectItem
}
from
'@grafana/ui/src/types'
;
...
...
@@ -14,26 +13,28 @@ export interface Props {
current
:
DataSourceSelectItem
;
onBlur
?:
()
=>
void
;
autoFocus
?:
boolean
;
openMenuOnFocus
?:
boolean
;
}
export
class
DataSourcePicker
extends
PureComponent
<
Props
>
{
static
defaultProps
=
{
static
defaultProps
:
Partial
<
Props
>
=
{
autoFocus
:
false
,
openMenuOnFocus
:
false
,
};
searchInput
:
HTMLElement
;
constructor
(
props
)
{
constructor
(
props
:
Props
)
{
super
(
props
);
}
onChange
=
item
=>
{
onChange
=
(
item
:
SelectOptionItem
)
=>
{
const
ds
=
this
.
props
.
datasources
.
find
(
ds
=>
ds
.
name
===
item
.
value
);
this
.
props
.
onChange
(
ds
);
};
render
()
{
const
{
datasources
,
current
,
autoFocus
,
onBlur
}
=
this
.
props
;
const
{
datasources
,
current
,
autoFocus
,
onBlur
,
openMenuOnFocus
}
=
this
.
props
;
const
options
=
datasources
.
map
(
ds
=>
({
value
:
ds
.
name
,
...
...
@@ -58,7 +59,7 @@ export class DataSourcePicker extends PureComponent<Props> {
options=
{
options
}
autoFocus=
{
autoFocus
}
onBlur=
{
onBlur
}
openMenuOnFocus=
{
true
}
openMenuOnFocus=
{
openMenuOnFocus
}
maxMenuHeight=
{
500
}
placeholder=
"Select datasource"
noOptionsMessage=
{
()
=>
'No datasources found'
}
...
...
public/app/features/dashboard/panel_editor/QueriesTab.tsx
View file @
a887c344
...
...
@@ -152,6 +152,7 @@ export class QueriesTab extends PureComponent<Props, State> {
current=
{
null
}
autoFocus=
{
true
}
onBlur=
{
this
.
onMixedPickerBlur
}
openMenuOnFocus=
{
true
}
/>
);
};
...
...
public/app/features/explore/QueryField.tsx
View file @
a887c344
...
...
@@ -408,8 +408,6 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS
}
};
handleFocus
=
()
=>
{};
onClickMenu
=
(
item
:
CompletionItem
)
=>
{
// Manually triggering change
const
change
=
this
.
applyTypeahead
(
this
.
state
.
value
.
change
(),
item
);
...
...
@@ -500,7 +498,6 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS
onBlur=
{
this
.
handleBlur
}
onKeyDown=
{
this
.
onKeyDown
}
onChange=
{
this
.
onChange
}
onFocus=
{
this
.
handleFocus
}
onPaste=
{
this
.
handlePaste
}
placeholder=
{
this
.
props
.
placeholder
}
plugins=
{
this
.
plugins
}
...
...
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