Fix autosave focus jump in card sidebar

Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
This commit is contained in:
Hoang Pham
2025-09-22 18:57:20 +07:00
parent 12b656dd8c
commit 50f35c7880
+10 -3
View File
@@ -178,9 +178,16 @@ export default {
}, },
}, },
watch: { watch: {
currentCard(newCard, oldCard) { currentCard: {
if (newCard.id === oldCard.id) return handler(newCard, oldCard) {
this.focusHeader() if (!newCard) {
return
}
// Only refocus when actually switching cards, not during autosave updates
if (!oldCard?.id || newCard.id !== oldCard.id) {
this.focusHeader()
}
},
}, },
'currentCard.title': { 'currentCard.title': {
immediate: true, immediate: true,