Merge pull request #6161 from nextcloud/backport/6140/stable29

[stable29] fix: losing focus while editing title field
This commit is contained in:
Julius Härtl
2024-08-01 22:32:00 +02:00
committed by GitHub
3 changed files with 16 additions and 1 deletions

View File

@@ -17,7 +17,7 @@
import './commands.js' import './commands.js'
Cypress.on('uncaught:exception', (err) => { Cypress.on('uncaught:exception', (err) => {
return !err.message.includes('ResizeObserver loop limit exceeded') return !err.message.includes('ResizeObserver loop limit exceeded') && !err.message.includes('ResizeObserver loop completed with undelivered notifications')
}) })
// Alternatively you can use CommonJS syntax: // Alternatively you can use CommonJS syntax:

View File

@@ -118,6 +118,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"
@@ -229,6 +230,13 @@ export default {
}, },
}, },
}, },
watch: {
showAddCard(newValue) {
if (!newValue) {
this.$store.dispatch('toggleShortcutLock', false)
}
},
},
methods: { methods: {
stopCardCreation(e) { stopCardCreation(e) {
@@ -318,6 +326,9 @@ export default {
this.stateCardCreating = false this.stateCardCreating = false
} }
}, },
onCreateCardFocus() {
this.$store.dispatch('toggleShortcutLock', true)
},
}, },
} }
</script> </script>

View File

@@ -130,6 +130,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',
@@ -205,6 +206,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()
}, },