fix(dees-pdf-viewer): add top scroll offset when navigating to a page in the PDF viewer
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user