fix(dees-pdf-viewer): add top scroll offset when navigating to a page in the PDF viewer

This commit is contained in:
2026-04-03 19:58:51 +00:00
parent 3defbba5fd
commit d933c47b49
3 changed files with 9 additions and 3 deletions

View File

@@ -1,5 +1,11 @@
# Changelog # 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) ## 2026-04-03 - 3.52.4 - fix(appui-maincontent)
adjust main content background theme colors adjust main content background theme colors

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@design.estate/dees-catalog', 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.' description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
} }

View File

@@ -733,8 +733,8 @@ export class DeesPdfViewer extends DeesElement {
const viewerRect = this.viewerMain.getBoundingClientRect(); const viewerRect = this.viewerMain.getBoundingClientRect();
const currentScrollTop = this.viewerMain.scrollTop; const currentScrollTop = this.viewerMain.scrollTop;
// Calculate the target scroll position // 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; const targetScrollTop = currentScrollTop + (pageRect.top - viewerRect.top) - this.viewerMain.clientTop - 16;
// Scroll to the calculated position // Scroll to the calculated position
if (smooth) { if (smooth) {