Skip to content

Commit 50f35c7

Browse files
committed
Fix autosave focus jump in card sidebar
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
1 parent 12b656d commit 50f35c7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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)