Skip to content

Commit

Permalink
chore(chart): Save modal select placeholder value (#12413)
Browse files Browse the repository at this point in the history
* Fix SaveModal select value

* var name change and null

* Address Comments
  • Loading branch information
nikolagigic authored Jan 20, 2021
1 parent 10c2b09 commit a422c76
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions superset-frontend/src/explore/components/SaveModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a422c76

Please sign in to comment.