Skip to content
Snippets Groups Projects

Resolve "Eingabe einer Zahl außerhalb des Kommentarfeldes trägt Zahl in Score ein"

3 files
+ 41
1
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -18,6 +18,7 @@
@@ -18,6 +18,7 @@
<v-flex xs5 class="score-flex">
<v-flex xs5 class="score-flex">
<span class="mr-2">Score:</span>
<span class="mr-2">Score:</span>
<input class="score-text-field"
<input class="score-text-field"
 
v-shortkey="'numeric'" @shortkey="handleKeypress"
id="score-input"
id="score-input"
type="number"
type="number"
step="0.5"
step="0.5"
@@ -172,6 +173,18 @@ export default {
@@ -172,6 +173,18 @@ export default {
} else {
} else {
throw new Error("Can't skip submission when skippable is false for AnnotatedSubmissionBottomToolbar.")
throw new Error("Can't skip submission when skippable is false for AnnotatedSubmissionBottomToolbar.")
}
}
 
},
 
handleKeypress (event) {
 
// only handle keypress if nothing is focused
 
if (document.activeElement.tagName === "BODY") {
 
if (this.score === undefined) {
 
this.score = event.key
 
}
 
 
const scoreInput = document.getElementById('score-input')
 
scoreInput.scrollIntoView()
 
scoreInput.focus()
 
}
}
}
}
}
}
}
Loading