fix(cv): retain preview geometry while refreshing last-good pages
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user