fix: losing focus while editing title field
Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
@@ -100,6 +100,7 @@
|
|||||||
:placeholder="t('deck', 'Card name')"
|
:placeholder="t('deck', 'Card name')"
|
||||||
required
|
required
|
||||||
pattern=".*\S+.*"
|
pattern=".*\S+.*"
|
||||||
|
@focus="onCreateCardFocus"
|
||||||
@keydown.esc="stopCardCreation">
|
@keydown.esc="stopCardCreation">
|
||||||
<input v-show="!stateCardCreating"
|
<input v-show="!stateCardCreating"
|
||||||
class="icon-confirm"
|
class="icon-confirm"
|
||||||
@@ -211,6 +212,13 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
showAddCard(newValue) {
|
||||||
|
if (!newValue) {
|
||||||
|
this.$store.dispatch('toggleShortcutLock', false)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
stopCardCreation(e) {
|
stopCardCreation(e) {
|
||||||
@@ -300,6 +308,9 @@ export default {
|
|||||||
this.stateCardCreating = false
|
this.stateCardCreating = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onCreateCardFocus() {
|
||||||
|
this.$store.dispatch('toggleShortcutLock', true)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ export default {
|
|||||||
showArchived: state => state.showArchived,
|
showArchived: state => state.showArchived,
|
||||||
currentBoard: state => state.currentBoard,
|
currentBoard: state => state.currentBoard,
|
||||||
showCardCover: state => state.showCardCover,
|
showCardCover: state => state.showCardCover,
|
||||||
|
shortcutLock: state => state.shortcutLock,
|
||||||
}),
|
}),
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'isArchived',
|
'isArchived',
|
||||||
@@ -184,6 +185,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
focus(card) {
|
focus(card) {
|
||||||
|
if (this.shortcutLock) {
|
||||||
|
return
|
||||||
|
}
|
||||||
card = this.$refs[`card${card}`]
|
card = this.$refs[`card${card}`]
|
||||||
card.focus()
|
card.focus()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user