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

pdfx web - bouncing behaviour is quite annoying when scrolling #296

Closed
BenPoell opened this issue May 15, 2022 · 4 comments · Fixed by #435
Closed

pdfx web - bouncing behaviour is quite annoying when scrolling #296

BenPoell opened this issue May 15, 2022 · 4 comments · Fixed by #435
Assignees
Labels
bug Something isn't working

Comments

@BenPoell
Copy link

Describe the bug
When scrolling a lager PDF with the mouse (especially with smaller wheel spin) the scrolling behavoiur with it's bouncing is quite annoying.
As you can see here in this animation you even get stuck sometimes on the same place (e.g. at page break):
ezgif-5-fc51c92db2

To Reproduce
I'm taking a fileBase64Decoded PDF but this shouldn't matter though. It just needs to be multiple pages.

I tried playing around a bit with pageSnapping and the physics but there was no real satisfiying result.

Behaviour is same in Chrome and Edge.

PdfController? pdfController = PdfController(
              document: PdfDocument.openData(fileDecoded),
            );

PdfView(
  controller: pdfController!,
  scrollDirection: Axis.vertical,
  pageSnapping: !kIsWeb,
  physics: PageScrollPhysics(),
  builders: PdfViewBuilders<DefaultBuilderOptions>(
    options: const DefaultBuilderOptions(),
    documentLoaderBuilder: (context) => Center(
      child: CircularProgressIndicator(
        valueColor: AlwaysStoppedAnimation(Theme.of(context).primaryColor),
      ),
    ),
    pageLoaderBuilder: (context) => Center(
      child: CircularProgressIndicator(
        valueColor: AlwaysStoppedAnimation(Theme.of(context).primaryColor),
      ),
    ),
  ),
);

Expected behavior
pageSnapping: false should actually not pageSnap

OR

Based on the given ScrollPhysics an according scrolling behaviour, e.g.

  • bouncing when BouncingScrollPhysics
  • maintaining the amount of overscroll or underscroll when RangeMaintainingScrollPhysics

OR

it would actually be nice to have a scrollbar available, like already mentioned in #81.

@BenPoell BenPoell added the bug Something isn't working label May 15, 2022
@BenPoell
Copy link
Author

Maybe it would also be worth a try to implement it's own ScrollController to kinda control the scroll behaviour on your own. But it seems like this whole scrolling stuff is somewhere deep in related packages like photo_view_gallery.

My idea was to create some sort of controller like here in this package and wrap the PdfView with it:
https://pub.dev/packages/smooth_scroll_web

@waketeck
Copy link

Are there any news regarding this issues. We still have this behavior.
Do you have planned to provide a fix for it?
Many thanks for your response.

@FilipObornik
Copy link

I would like to push resolution of this issue 🙏 I like the library but this bounding behaviour while viewing PDF will probably make me search for another library if not resolved soon.

@rodriwaw
Copy link

Same as @FilipObornik, the library is quite useful but having no control over scrolling is annoying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants