Skip to content

Commit

Permalink
Merge pull request #6161 from nextcloud/backport/6140/stable29
Browse files Browse the repository at this point in the history
[stable29] fix: losing focus while editing title field
  • Loading branch information
juliusknorr authored Aug 1, 2024
2 parents 426197f + 32db88c commit 38b7b35
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import './commands.js'

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:
Expand Down
11 changes: 11 additions & 0 deletions src/components/board/Stack.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
:placeholder="t('deck', 'Card name')"
required
pattern=".*\S+.*"
@focus="onCreateCardFocus"
@keydown.esc="stopCardCreation">
<input v-show="!stateCardCreating"
class="icon-confirm"
Expand Down Expand Up @@ -229,6 +230,13 @@ export default {
},
},
},
watch: {
showAddCard(newValue) {
if (!newValue) {
this.$store.dispatch('toggleShortcutLock', false)
}
},
},

methods: {
stopCardCreation(e) {
Expand Down Expand Up @@ -318,6 +326,9 @@ export default {
this.stateCardCreating = false
}
},
onCreateCardFocus() {
this.$store.dispatch('toggleShortcutLock', true)
},
},
}
</script>
Expand Down
4 changes: 4 additions & 0 deletions src/components/cards/CardItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default {
showArchived: state => state.showArchived,
currentBoard: state => state.currentBoard,
showCardCover: state => state.showCardCover,
shortcutLock: state => state.shortcutLock,
}),
...mapGetters([
'isArchived',
Expand Down Expand Up @@ -205,6 +206,9 @@ export default {
},
methods: {
focus(card) {
if (this.shortcutLock) {
return
}
card = this.$refs[`card${card}`]
card.focus()
},
Expand Down

0 comments on commit 38b7b35

Please sign in to comment.