Merge pull request #1015 from yo35/fix-issue-1003-title-out-of-sync

fix: title possibly out of sync in DockviewDefaultTab (#1003)
This commit is contained in:
mathuo 2025-10-10 22:36:29 +01:00 committed by GitHub
commit a7bef6db80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,6 +10,11 @@ function useTitle(api: DockviewPanelApi): string | undefined {
setTitle(event.title);
});
// Depending on the order in which React effects are run, the title may already be out of sync (cf. issue #1003).
if (title !== api.title) {
setTitle(api.title);
}
return () => {
disposable.dispose();
};