aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Question.tsx
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2021-01-19 20:04:36 +0200
committerGravatar ks129 <[email protected]>2021-01-19 20:04:36 +0200
commit79f9c89ad857a81e349ad5d0974803ee50b98b16 (patch)
tree1eae9d6253f7e0fca12344713fca6c29d1d3e43e /src/components/Question.tsx
parentAdd webkit CSS to invalidStyle to support Safari (diff)
Merge switch's cases
Diffstat (limited to 'src/components/Question.tsx')
-rw-r--r--src/components/Question.tsx24
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;