Skip to content

Commit a513781

Browse files
committed
Avoid refocusing card title on autosave updates
Signed-off-by: Hoang Pham <[email protected]>
1 parent 50f35c7 commit a513781

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/card/CardSidebar.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export default {
141141
hasActivity: capabilities && capabilities.activity,
142142
locale: getLocale(),
143143
activeTabId: this.tabId || 'details',
144+
lastFocusedCardId: null,
144145
}
145146
},
146147
computed: {
@@ -179,13 +180,15 @@ export default {
179180
},
180181
watch: {
181182
currentCard: {
182-
handler(newCard, oldCard) {
183+
handler(newCard) {
183184
if (!newCard) {
185+
this.lastFocusedCardId = null
184186
return
185187
}
186-
// Only refocus when actually switching cards, not during autosave updates
187-
if (!oldCard?.id || newCard.id !== oldCard.id) {
188+
// Only refocus when the user switches to a different card
189+
if (this.lastFocusedCardId !== newCard.id) {
188190
this.focusHeader()
191+
this.lastFocusedCardId = newCard.id
189192
}
190193
},
191194
},

0 commit comments

Comments
 (0)