Skip to content

Commit

Permalink
fix input bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
GeneralMine committed Jul 12, 2021
1 parent affedd2 commit 7038ad7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/lib/Survey/SurveyPage/Question.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
if (!question.answer) {
question.answer = {};
}
$: console.log(question.answer);
</script>

<div class="content">
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Survey/SurveyPage/inputs/BooleanInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import RadioButtonInput from './RadioButtonInput.svelte';
export let options = ['Ja', 'Nein'];
export let bool;
export let boolean;
export let edit;
</script>

<RadioButtonInput {options} bind:radioButton={bool} {edit} />
<RadioButtonInput {options} bind:radiobutton={boolean} {edit} />
4 changes: 2 additions & 2 deletions src/lib/Survey/SurveyPage/inputs/CheckBoxInput.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script>
export let options;
export let selection;
export let checkbox;
let raw = [];
function updateSelection() {
selection = options.map((el, index) => raw.includes(index));
checkbox = options.map((el, index) => raw.includes(index));
}
</script>

Expand Down
4 changes: 2 additions & 2 deletions src/lib/Survey/SurveyPage/inputs/RadioButtonInput.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script>
export let options;
export let radioButton;
export let radiobutton;
</script>

<div class="row">
{#each options as value}
<div class="column">
<label>
<input type="radio" bind:group={radioButton} {value} />
<input type="radio" bind:group={radiobutton} {value} />
{value}
</label>
</div>
Expand Down

0 comments on commit 7038ad7

Please sign in to comment.