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
9cf84c51
Unverified
Commit
9cf84c51
authored
Feb 20, 2020
by
Tobias Skarhed
Committed by
GitHub
Feb 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Select: Fix focus issue and remove select container (#22309)
parent
49fe4ff6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
20 deletions
+23
-20
packages/grafana-ui/src/components/Forms/Select/SelectBase.tsx
+5
-16
packages/grafana-ui/src/components/Forms/commonStyles.ts
+18
-4
No files found.
packages/grafana-ui/src/components/Forms/Select/SelectBase.tsx
View file @
9cf84c51
...
...
@@ -11,7 +11,7 @@ import { default as AsyncCreatable } from '@torkelo/react-select/async-creatable
import
{
Icon
}
from
'../../Icon/Icon'
;
import
{
css
,
cx
}
from
'emotion'
;
import
{
inputSizes
}
from
'../commonStyles'
;
import
{
inputSizes
Pixels
}
from
'../commonStyles'
;
import
{
FormInputSize
}
from
'../types'
;
import
resetSelectStyles
from
'./resetSelectStyles'
;
import
{
SelectMenu
,
SelectMenuOptions
}
from
'./SelectMenu'
;
...
...
@@ -235,7 +235,6 @@ export function SelectBase<T>({
menuShouldScrollIntoView
:
false
,
renderControl
,
captureMenuScroll
:
false
,
blurInputOnSelect
:
true
,
menuPlacement
:
'auto'
,
};
...
...
@@ -287,20 +286,6 @@ export function SelectBase<T>({
{
props
.
children
}
</
div
>
),
SelectContainer
:
(
props
:
any
)
=>
(
<
div
{
...
props
.
innerProps
}
className=
{
cx
(
css
(
props
.
getStyles
(
'container'
,
props
)),
css
`
position: relative;
`
,
inputSizes
()[
size
]
)
}
>
{
props
.
children
}
</
div
>
),
IndicatorsContainer
:
IndicatorsContainer
,
IndicatorSeparator
:
()
=>
<></>,
Control
:
CustomControl
,
...
...
@@ -348,6 +333,10 @@ export function SelectBase<T>({
marginBottom
:
!!
bottom
?
'10px'
:
'0'
,
zIndex
:
9999
,
}),
container
:
()
=>
({
position
:
'relative'
,
width
:
inputSizesPixels
(
size
),
}),
}
}
className=
{
widthClass
}
{
...
commonSelectProps
}
...
...
packages/grafana-ui/src/components/Forms/commonStyles.ts
View file @
9cf84c51
...
...
@@ -57,20 +57,34 @@ export const sharedInputStyle = (theme: GrafanaTheme, invalid = false) => {
export
const
inputSizes
=
()
=>
{
return
{
sm
:
css
`
width:
200px
;
width:
${
inputSizesPixels
(
'sm'
)}
;
`
,
md
:
css
`
width:
320px
;
width:
${
inputSizesPixels
(
'md'
)}
;
`
,
lg
:
css
`
width:
580px
;
width:
${
inputSizesPixels
(
'lg'
)}
;
`
,
auto
:
css
`
width:
auto
;
width:
${
inputSizesPixels
(
'auto'
)}
;
`
,
};
};
export
const
inputSizesPixels
=
(
size
:
string
)
=>
{
switch
(
size
)
{
case
'sm'
:
return
'200px'
;
case
'md'
:
return
'320px'
;
case
'lg'
:
return
'580px'
;
case
'auto'
:
default
:
return
'auto'
;
}
};
export
const
getPropertiesForButtonSize
=
(
theme
:
GrafanaTheme
,
size
:
ButtonSize
)
=>
{
switch
(
size
)
{
case
'sm'
:
...
...
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