Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable29] fix: losing focus while editing title field #6161

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading