Skip to content

Commit

Permalink
Merge pull request #33 from mad-lab-fau/dev
Browse files Browse the repository at this point in the history
fix: focus does not jump to incorrect inputs when an entry is made
  • Loading branch information
roschro-fau authored Apr 29, 2024
2 parents 148584e + a9f8832 commit 438404f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/preparation/BarcodeForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
for(let id of idList) {
let element = document.getElementById(id);
if(element instanceof HTMLInputElement){
if(!(element.reportValidity())){
if(!element.checkValidity()){
return false;
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/lib/components/preparation/QrCodeForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}
for (let id of idList) {
let element = document.getElementById(id);
if (element instanceof HTMLInputElement && !element.reportValidity()) {
if (element instanceof HTMLInputElement && !element.checkValidity()) {
return false;
}
}
Expand Down Expand Up @@ -216,7 +216,8 @@
id="distance{i}"
type="number"
bind:value={salivaDistances[i]}
on:input={salivaListChanged}/>
on:input={salivaListChanged}
required />
<div class="input-group-shim">min</div>
</div>
{/each}
Expand All @@ -232,7 +233,8 @@
id="time{i}"
type="time"
bind:value={salivaTimes[i]}
on:input={salivaListChanged}/>
on:input={salivaListChanged}
required />
</div>
{/each}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/preparation/StudyForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$: $studyProps, studyPropsValid.set(isValid());
function isValid(){
let permanentIdList = ["study_name", "num_days", "num_samples", "pref_bio"]
let permanentIdList = ["study_name", "num_days", "num_samples", "prefix_bio"]
let optionalIdList = ["num_participants"]
if (!validateInputsFromList(permanentIdList)){
return false;
Expand All @@ -41,7 +41,7 @@
for(let id of list) {
let element = document.getElementById(id);
if(element instanceof HTMLInputElement){
if(!(element.reportValidity())){
if(!(element.checkValidity())) {
return false;
}
}
Expand Down

0 comments on commit 438404f

Please sign in to comment.