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
88c3b719
Unverified
Commit
88c3b719
authored
Mar 10, 2020
by
Alex Khomenko
Committed by
GitHub
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grafana UI: Fix Forms.Select onChangeWithEmpty (#22647)
* Sort props * Add missing deps to useCallback
parent
0e7c746a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
52 deletions
+52
-52
packages/grafana-ui/src/components/Forms/Select/SelectBase.tsx
+52
-52
No files found.
packages/grafana-ui/src/components/Forms/Select/SelectBase.tsx
View file @
88c3b719
...
...
@@ -65,44 +65,44 @@ const CustomControl = (props: any) => {
};
export
function
SelectBase
<
T
>
({
value
,
allowCustomValue
=
false
,
autoFocus
=
false
,
backspaceRemovesValue
=
true
,
components
,
defaultOptions
,
defaultValue
,
inputValue
,
onInputChange
,
onCreateOption
,
options
=
[],
onChange
,
onBlur
,
onKeyDown
,
onCloseMenu
,
onOpenMenu
,
placeholder
=
'Choose'
,
getOptionValue
,
getOptionLabel
,
isSearchable
=
true
,
disabled
=
false
,
formatCreateLabel
,
getOptionLabel
,
getOptionValue
,
inputValue
,
invalid
,
isClearable
=
false
,
isMulti
=
false
,
isLoading
=
false
,
isMulti
=
false
,
isOpen
,
autoFocus
=
false
,
openMenuOnFocus
=
false
,
isSearchable
=
true
,
loadOptions
,
loadingMessage
=
'Loading options...'
,
maxMenuHeight
=
300
,
menuPosition
,
noOptionsMessage
=
'No options found'
,
tabSelectsValue
=
true
,
backspaceRemovesValue
=
true
,
allowCustomValue
=
false
,
size
=
'auto'
,
onBlur
,
onChange
,
onCloseMenu
,
onCreateOption
,
onInputChange
,
onKeyDown
,
onOpenMenu
,
openMenuOnFocus
=
false
,
options
=
[],
placeholder
=
'Choose'
,
prefix
,
formatCreateLabel
,
loadOptions
,
loadingMessage
=
'Loading options...'
,
defaultOptions
,
renderControl
,
size
=
'auto'
,
tabSelectsValue
=
true
,
value
,
width
,
invalid
,
components
,
menuPosition
,
}:
SelectBaseProps
<
T
>
)
{
const
theme
=
useTheme
();
const
styles
=
getSelectStyles
(
theme
);
...
...
@@ -113,7 +113,7 @@ export function SelectBase<T>({
}
onChange
(
value
);
},
[
isMulti
]
[
isMulti
,
value
,
onChange
]
);
let
ReactSelectComponent
:
ReactSelect
|
Creatable
=
ReactSelect
;
const
creatableProps
:
any
=
{};
...
...
@@ -141,39 +141,39 @@ export function SelectBase<T>({
const
commonSelectProps
=
{
autoFocus
,
placeholder
,
isSearchable
,
// Passing isDisabled as react-select accepts this prop
isDisabled
:
disabled
,
backspaceRemovesValue
,
captureMenuScroll
:
false
,
defaultValue
,
// Also passing disabled, as this is the new Select API, and I want to use this prop instead of react-select's one
disabled
,
getOptionLabel
,
getOptionValue
,
inputValue
,
invalid
,
prefix
,
isClearable
,
// Passing isDisabled as react-select accepts this prop
isDisabled
:
disabled
,
isLoading
,
isMulti
,
isSearchable
,
maxMenuHeight
,
menuIsOpen
:
isOpen
,
defaultValue
,
inputValue
,
menuPlacement
:
'auto'
,
menuPosition
,
menuShouldScrollIntoView
:
false
,
onBlur
,
onChange
:
onChangeWithEmpty
,
onInputChange
,
value
:
isMulti
?
selectedValue
:
selectedValue
[
0
],
getOptionLabel
,
getOptionValue
,
openMenuOnFocus
,
maxMenuHeight
,
isMulti
,
backspaceRemovesValue
,
onMenuOpen
:
onOpenMenu
,
onKeyDown
,
onMenuClose
:
onCloseMenu
,
tabSelectsValue
,
onMenuOpen
:
onOpenMenu
,
openMenuOnFocus
,
options
,
onChange
:
onChangeWithEmpty
,
onBlur
,
onKeyDown
,
menuShouldScrollIntoView
:
false
,
placeholder
,
prefix
,
renderControl
,
captureMenuScroll
:
false
,
menuPlacement
:
'auto'
,
menuPosition
,
tabSelectsValue
,
value
:
isMulti
?
selectedValue
:
selectedValue
[
0
],
};
// width property is deprecated in favor of size or className
...
...
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