From d933c47b49d7493198acbada204349331bdb2ea2 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Fri, 3 Apr 2026 19:58:51 +0000 Subject: [PATCH] fix(dees-pdf-viewer): add top scroll offset when navigating to a page in the PDF viewer --- changelog.md | 6 ++++++ ts_web/00_commitinfo_data.ts | 2 +- ts_web/elements/00group-media/dees-pdf-viewer/component.ts | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 789956c..224197c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2026-04-03 - 3.52.5 - fix(dees-pdf-viewer) +add top scroll offset when navigating to a page in the PDF viewer + +- Subtracts 16px from the calculated scroll target so the selected page is not flush against the top edge of the viewer. +- Improves page navigation positioning in the dees-pdf-viewer component. + ## 2026-04-03 - 3.52.4 - fix(appui-maincontent) adjust main content background theme colors diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index f25eb68..f44a9e6 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@design.estate/dees-catalog', - version: '3.52.4', + version: '3.52.5', description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.' } diff --git a/ts_web/elements/00group-media/dees-pdf-viewer/component.ts b/ts_web/elements/00group-media/dees-pdf-viewer/component.ts index 43d0c17..50d5b74 100644 --- a/ts_web/elements/00group-media/dees-pdf-viewer/component.ts +++ b/ts_web/elements/00group-media/dees-pdf-viewer/component.ts @@ -733,8 +733,8 @@ export class DeesPdfViewer extends DeesElement { const viewerRect = this.viewerMain.getBoundingClientRect(); const currentScrollTop = this.viewerMain.scrollTop; - // Calculate the target scroll position - const targetScrollTop = currentScrollTop + (pageRect.top - viewerRect.top) - this.viewerMain.clientTop; + // Calculate the target scroll position (offset by 16px so page doesn't touch the top edge) + const targetScrollTop = currentScrollTop + (pageRect.top - viewerRect.top) - this.viewerMain.clientTop - 16; // Scroll to the calculated position if (smooth) {