fix(cv): retain preview geometry while refreshing last-good pages

This commit is contained in:
cesnimda
2026-10-26 04:01:22 +01:00
parent 8979244576
commit 61f412bb27
3 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -651,7 +651,7 @@ export default function CvBuilderEditor() {
<Typography variant="caption" color="text.secondary" role="status">
{previewBusy ? t("cvEditorUpdatingPreview") : previewReady ? t("cvEditorPageCount", { count: pages }) : null}
</Typography>
{previewReady && pages > 1 && <TextField select size="small" label={t("cvEditorGoToPage")} value="" sx={{ minWidth: 140 }} onChange={(event) => {
{!!html && pages > 1 && <TextField select size="small" disabled={!previewReady} label={t("cvEditorGoToPage")} value="" sx={{ minWidth: 140 }} onChange={(event) => {
const pane = scrollRef.current;
const page = pane?.querySelector<HTMLElement>(`[data-cv-page="${Number(event.target.value)}"]`);
if (pane && page) pane.scrollTop += page.getBoundingClientRect().top - pane.getBoundingClientRect().top;