Skip to content

Commit

Permalink
Fix the bug: coupled text disappears after edit
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlorUpload committed Jul 29, 2020
1 parent 3331a72 commit 7b4a072
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions MindBridgeWebEditor/src/screen-comp/draw-comp/Question.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
IconButton,
Select,
MenuItem,
Grid,
Radio,
} from "@material-ui/core";

Expand Down Expand Up @@ -73,6 +72,8 @@ export default class Question extends React.Component {
return <ChartType1 {...this.props} />;
case 2:
return <ChartType2 {...this.props} />;
default:
return;
}
};
}
Expand Down Expand Up @@ -279,7 +280,7 @@ class ChartType1 extends React.Component {
style={ind !== 0 ? { width: "100%" } : { width: "30%" }}
key={ind}
>
{ind == 0 ? (
{ind === 0 ? (
<div />
) : this.state.choice_edit_id === ind ? (
<Input
Expand Down Expand Up @@ -313,7 +314,7 @@ class ChartType1 extends React.Component {
style={ind !== 0 ? { width: "100%" } : { width: "30%" }}
key={ind}
>
{ind == 0 ? (
{ind === 0 ? (
this.state.couple_edit_id === couple_ind ? (
<Input
value={this.state.couple_edit}
Expand All @@ -330,13 +331,11 @@ class ChartType1 extends React.Component {
this.setState({
couple_edit_id: couple_ind,
couple_edit:
this.props.question.couple_list? this.props.question.couple_list[couple_ind] :
["남편", "아내"][couple_ind],
this.props.question.couple_list? this.props.question.couple_list[couple_ind] || ["남편", "아내"][couple_ind] : ["남편", "아내"][couple_ind],
});
}}
>
{this.props.question.couple_list? this.props.question.couple_list[couple_ind] :
["남편", "아내"][couple_ind]}
{this.props.question.couple_list? this.props.question.couple_list[couple_ind] || ["남편", "아내"][couple_ind] : ["남편", "아내"][couple_ind]}
</Button>
)
) : (
Expand Down

0 comments on commit 7b4a072

Please sign in to comment.