Skip to content

Commit

Permalink
Merge pull request #232 from CogStack/shortcuts-bug
Browse files Browse the repository at this point in the history
CU-86982juwz: Fix condition on key board shortcuts
  • Loading branch information
tomolopolis authored Feb 25, 2025
2 parents 8cab01c + 45f9c9a commit 082906a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions webapp/frontend/src/components/anns/TaskBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ export default {
],
watch: {
'submitLocked' (newVal) {
if (newVal) {
this.listenSubmit()
if (newVal === null || newVal === false) {
this.listenShortcuts()
} else {
this.ignoreSubmit()
this.ignoreShortcuts()
}
}
},
Expand Down Expand Up @@ -79,7 +79,7 @@ export default {
keydown (e) {
if (e.keyCode === 13 && !this.conceptSelection) {
if (!this.submitDisabled()) {
this.ignoreSubmit()
this.ignoreShortcuts()
this.submit()
}
} else if (e.keyCode >= 49 && e.keyCode < 54 && !this.taskLocked) {
Expand Down Expand Up @@ -108,18 +108,18 @@ export default {
}
}
},
listenSubmit () {
listenShortcuts () {
window.addEventListener('keydown', this.keydown)
},
ignoreSubmit () {
ignoreShortcuts () {
window.removeEventListener('keydown', this.keydown)
}
},
mounted () {
this.listenSubmit()
this.listenShortcuts()
},
beforeDestroy () {
this.ignoreSubmit()
this.ignoreShortcuts()
}
}
</script>
Expand Down

0 comments on commit 082906a

Please sign in to comment.