chore(chart): Save modal select placeholder value (#12413)

* Fix SaveModal select value

* var name change and null

* Address Comments
This commit is contained in:
Nikola Gigić
2021-01-20 07:17:56 +01:00
committed by GitHub
parent 10c2b09942
commit a422c765c7

View File

@@ -158,6 +158,11 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
}
render() {
const dashboardSelectValue =
this.state.saveToDashboardId || this.state.newDashboardName;
const valueObj = dashboardSelectValue
? { value: dashboardSelectValue }
: null;
return (
<StyledModal
show
@@ -248,15 +253,13 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
<CreatableSelect
id="dashboard-creatable-select"
className="save-modal-selector"
menuPosition="fixed"
options={this.props.dashboards}
clearable
creatable
onChange={this.onDashboardSelectChange}
autoSize={false}
value={{
value:
this.state.saveToDashboardId || this.state.newDashboardName,
}}
value={valueObj}
placeholder={
// Using markdown to allow for good i18n
<ReactMarkdown