Skip to content
Snippets Groups Projects
Commit d889307d authored by Quentin Bramas's avatar Quentin Bramas
Browse files

fix input

parent 5bd0cd0e
Branches
Tags
No related merge requests found
Pipeline #342150 passed with stages
in 58 seconds
......@@ -24,13 +24,13 @@ export default ({ type, value, slideId }) => (state, actions) => {
let answers = {};
currentAnswer
.split(' & ')
.filter(a => a)
.forEach(a => answers[a] = true);
return <div>{shuffled(value).map((v, i) => <div class="custom-control custom-radio" key={i}>
return <div>{shuffled(value).map((v, i) => <div class="custom-control custom-radio" key={"input-" + slideId + "-" + i}>
<input
disabled={state.kind != 'OFFLINE' && (state.free || state.finished)}
class="custom-control-input" id={'check-' + i} name={slideId} type='radio' checked={answers[v] ? 'checked' : ''}
class="custom-control-input" id={'check-' + i} name={slideId} type='radio' checked={!!answers[v]}
onclick={(e) => {
if (e.target.checked)
actions.setAnswer(v)
......@@ -47,10 +47,9 @@ export default ({ type, value, slideId }) => (state, actions) => {
let answers = {};
currentAnswer
.split(' & ')
.filter(a => a)
.forEach(a => answers[a] = true);
return <div>{shuffled(value).map((v, i) => <div class="custom-control custom-checkbox" key={i}>
return <div>{shuffled(value).map((v, i) => <div class="custom-control custom-checkbox" key={"input-" + slideId + "-" + i}>
<input class="custom-control-input" id={'check-' + i} type='checkbox'
checked={answers[v] ? 'checked' : ''}
disabled={state.kind != 'OFFLINE' && (state.free || state.finished)}
......@@ -74,6 +73,7 @@ export default ({ type, value, slideId }) => (state, actions) => {
return <div class="form-group">
<label for='input'>Réponse</label>
<input
key={"input-" + slideId}
disabled={state.kind != 'OFFLINE' && (state.free || state.finished)}
id='input'
type="text"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment