diff options
author | 2021-01-19 20:04:36 +0200 | |
---|---|---|
committer | 2021-01-19 20:04:36 +0200 | |
commit | 79f9c89ad857a81e349ad5d0974803ee50b98b16 (patch) | |
tree | 1eae9d6253f7e0fca12344713fca6c29d1d3e43e /src | |
parent | Add webkit CSS to invalidStyle to support Safari (diff) |
Merge switch's cases
Diffstat (limited to 'src')
-rw-r--r-- | src/components/Question.tsx | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/components/Question.tsx b/src/components/Question.tsx index df9d18e..750dd64 100644 --- a/src/components/Question.tsx +++ b/src/components/Question.tsx @@ -52,12 +52,7 @@ class RenderedQuestion extends React.Component<QuestionProp> { if (this.props.question.required) { let invalid = false; switch (this.props.question.type) { - case QuestionType.ShortText: - if (event.target.value === "") { - invalid = true; - } - break; - + case QuestionType.ShortText: case QuestionType.TextArea: if (event.target.value === "") { invalid = true; @@ -155,12 +150,7 @@ class RenderedQuestion extends React.Component<QuestionProp> { let invalid = false; const options: string | string[] = this.props.question.data["options"]; switch (this.props.question.type) { - case QuestionType.TextArea: - if (this.props.public_state.get("value") === "") { - invalid = true; - } - break; - + case QuestionType.TextArea: case QuestionType.ShortText: if (this.props.public_state.get("value") === "") { invalid = true; @@ -168,17 +158,7 @@ class RenderedQuestion extends React.Component<QuestionProp> { break; case QuestionType.Select: - if (!this.props.public_state.get("value")) { - invalid = true; - } - break; - case QuestionType.Range: - if (!this.props.public_state.get("value")) { - invalid = true; - } - break; - case QuestionType.Radio: if (!this.props.public_state.get("value")) { invalid = true; |