client: Fix center issue at startup

This commit is contained in:
Elian Doran 2024-09-01 16:44:55 +03:00
parent 6c54f3c804
commit b32f3ffd84
No known key found for this signature in database

View File

@ -69,6 +69,12 @@ export default class MindMapWidget extends TypeWidget {
this.spacedUpdate.scheduleUpdate(); this.spacedUpdate.scheduleUpdate();
} }
}); });
// If the note is displayed directly after a refresh, the scroll ends up at (0,0), making it difficult for the user to see.
// Adding an arbitrary wait until the element is attached to the DOM seems to do the trick for now.
setTimeout(() => {
mind.toCenter();
}, 200);
} }
async getData() { async getData() {