aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Question.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Question.tsx')
-rw-r--r--src/components/Question.tsx64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/components/Question.tsx b/src/components/Question.tsx
index e1472e4..34d12f7 100644
--- a/src/components/Question.tsx
+++ b/src/components/Question.tsx
@@ -46,24 +46,24 @@ class RenderedQuestion extends React.Component<QuestionProp> {
let value: string | boolean;
switch (event.target.type) {
- case "checkbox":
- target = event.target.name;
- value = event.target.checked;
- break;
-
- case "radio":
- // This handles radios and ranges, as they are both based on the same fundamental input type
- target = "value";
- if (event.target.parentElement) {
- value = event.target.parentElement.innerText.trimEnd();
- } else {
- value = event.target.value;
- }
- break;
+ case "checkbox":
+ target = event.target.name;
+ value = event.target.checked;
+ break;
+
+ case "radio":
+ // This handles radios and ranges, as they are both based on the same fundamental input type
+ target = "value";
+ if (event.target.parentElement) {
+ value = event.target.parentElement.innerText.trimEnd();
+ } else {
+ value = event.target.value;
+ }
+ break;
- default:
- target = "value";
- value = event.target.value;
+ default:
+ target = "value";
+ value = event.target.value;
}
this._setState(target, value);
@@ -85,21 +85,21 @@ class RenderedQuestion extends React.Component<QuestionProp> {
if (this.props.public_state.size === 0) {
switch (this.props.question.type) {
- case QuestionType.Checkbox:
- if (typeof options === "string") {
- return;
- }
-
- options.forEach((option, index) => {
- this._setState(`${("000" + index).slice(-4)}. ${option}`, false);
- });
- break;
-
- case QuestionType.Range:
- case QuestionType.Radio:
- case QuestionType.Select:
- this._setState("value", null);
- break;
+ case QuestionType.Checkbox:
+ if (typeof options === "string") {
+ return;
+ }
+
+ options.forEach((option, index) => {
+ this._setState(`${("000" + index).slice(-4)}. ${option}`, false);
+ });
+ break;
+
+ case QuestionType.Range:
+ case QuestionType.Radio:
+ case QuestionType.Select:
+ this._setState("value", null);
+ break;
}
}
}