Skip to content

Commit 5b17027

Browse files
committed
Fix autosave focus jump in card sidebar
1 parent 12b656d commit 5b17027

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎src/components/card/CardSidebar.vue‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,16 @@ export default {
178178
},
179179
},
180180
watch: {
181-
currentCard(newCard, oldCard) {
182-
if (newCard.id === oldCard.id) return
183-
this.focusHeader()
181+
currentCard: {
182+
handler(newCard, oldCard) {
183+
if (!newCard) {
184+
return
185+
}
186+
// Only refocus when actually switching cards, not during autosave updates
187+
if (!oldCard?.id || newCard.id !== oldCard.id) {
188+
this.focusHeader()
189+
}
190+
},
184191
},
185192
'currentCard.title': {
186193
immediate: true,

0 commit comments

Comments
 (0)