Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF toolbar with icons disappear during scrolling #2698

Closed
wider2 opened this issue Dec 26, 2024 · 8 comments
Closed

PDF toolbar with icons disappear during scrolling #2698

wider2 opened this issue Dec 26, 2024 · 8 comments
Assignees
Labels
Can't reproduce the bug You've reported a bug, but the feature works fine on my machine. So I don't know how to help you. Please send me a reproducer A reproducer is a minimal but working project showing the problem. user support You've got a question, or a misconfiguration, or simply need a hint how to get things up and running

Comments

@wider2
Copy link

wider2 commented Dec 26, 2024

Angular 17
ngx-extended-pdf-viewer: 22

I open the PDF file in the popup window
When I select the tool draw or input text and make some input or draw some layer over PDF content - it works perfectly
But if I try to scroll down some pages, the toolbar on the top with icons disappears.
The toolbar should be always on the top of whatever user scrolled down

@stephanrauh
Copy link
Owner

That doesn't happen here: https://pdfviewer.net/extended-pdf-viewer/modal
I suspect it has something to do with your application, and your CSS in particular. Can you prepare a reproducer? I.e. a minimal but complete example showing the problem and that runs without forcing me to install additional stuff?

@stephanrauh stephanrauh self-assigned this Dec 26, 2024
@stephanrauh stephanrauh added Please send me a reproducer A reproducer is a minimal but working project showing the problem. user support You've got a question, or a misconfiguration, or simply need a hint how to get things up and running Can't reproduce the bug You've reported a bug, but the feature works fine on my machine. So I don't know how to help you. labels Dec 26, 2024
@wider2
Copy link
Author

wider2 commented Jan 2, 2025

pdf toolbar miseed

if i try to add an attached pictures, top toolbar of tools missed. (see screenshot) Toolbar should be set on the top as a rock.

@stephanrauh
Copy link
Owner

There's an error message in the console window. What's happening there? Set [minifiedJSLibraries]="false" for simplified debugging, please.

@wider2
Copy link
Author

wider2 commented Jan 2, 2025

Uncaught TypeError: Cannot read properties of undefined (reading 'type')

if (evt.dataTransfer.files?.[0].type

detailed:

    appConfig.mainContainer.addEventListener("drop", function (evt) {
      if (AppOptions.get("enableDragAndDrop")) {
        if (evt.dataTransfer.files?.[0].type !== "application/pdf") {
          return;
        }
        evt.preventDefault();
        evt.stopPropagation();
        eventBus.dispatch("fileinputchange", {
          source: this,
          fileInput: evt.dataTransfer,
          dropEvent: evt
        });
      }
    });

but this error appears only when trying to select the text, draw hightlight line

My question mostly about missed toolbar when trying to add a new image

try locally to add an image over the pdf layers - and you will see how top tollbar tools missed, disappears

@stephanrauh
Copy link
Owner

It seems you've accidentally reported a bug you didn't want to report. :)

I think you bug is a CSS issue. I suspect you're scrolling the entire PDF viewer instead of scrolling the payload div inside the viewer. Without seeing your source code, it's hard to tell more, but I think that's where you should look. Try to find out which div is scrollable.

@wider2
Copy link
Author

wider2 commented Jan 2, 2025

I have not mentioned scrollbars in the algorithm
During the test, i discovered the following:

  1. small images (< 300px) attached to the PDF layer very well
  2. but big image attachments create a problem - damaged toolbar at once and he disappear

@wider2
Copy link
Author

wider2 commented Jan 3, 2025

it seems to be i have found the solution:
just need to add a property to the library

[height]="'100vh'"

.pdf-viewer-container {
  height: 100vh;
  overflow: auto;
}

@stephanrauh
Copy link
Owner

Let's close the ticket. I'm pretty sure there's something strange going on in your application, but without seeing it, I can't even guess what it might be. I'm happy you've found a work-around!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can't reproduce the bug You've reported a bug, but the feature works fine on my machine. So I don't know how to help you. Please send me a reproducer A reproducer is a minimal but working project showing the problem. user support You've got a question, or a misconfiguration, or simply need a hint how to get things up and running
Projects
None yet
Development

No branches or pull requests

2 participants