question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I add a scrollbar?

See original GitHub issue

I would like to fix the showing area width, and in the meantime, can scroll the pdf page if it is beyond the area width.

The way I use it now is <Document> <Page width={a fixed number} scale={a changeable number}/> </Document> . But I don’t think this is the right way. plus if fix the width in Page, I cannot zoom in/out by changing the scale.

Can you please advise?

thank you.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
ianzencommented, Jan 10, 2019

@bfang711 , did you find a solution to add scrollbars? Is it possible to add the feature which enables drag on PDF to show the beyond area content? Which I think will provide a better user experience.

@chinalwb You can wrap the Document/Page element in a div with a specified height and style={{overflow: “scroll”}}. If the pdf element overflows this div then a scrollbar will be added. I’m currently using this approach to enable scrolling in my project with scrollbars set to hidden. Rendering multiple pages for large pdfs and getting it to interact well with scrolling is non-trivial. See https://github.com/wojtekmaj/react-pdf/issues/94

1reaction
chinalwbcommented, Jan 21, 2019

Just an update for my issue. I need to add transform: translate(0px, 50px) and overflow: scroll to the <div> under the toolbar. Thanks again @wojtekmaj for the advice and the wonderful pdf render component!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you add a scroll bar to a div? - Stack Overflow
You need to add style="overflow-y:scroll;" to the div tag. (This will force a scrollbar on the vertical). If you only want a scrollbar...
Read more >
How To Create a Custom Scrollbar - W3Schools
Learn how to create a custom scrollbar with CSS. Custom Scrollbars. Custom Scrollbar Example. Note: The -webkit-scrollbar is not supported in Firefox or...
Read more >
Learn How to Create a Scrollbar in Html Table? - eduCBA
Suppose we want to add a scroll bar option in HTML, use an “overflow” option and set it as auto-enabled for adding both...
Read more >
How to add scrollbar to div - Educative.io
To add scrollbar on both axes, you can add the overflow property instead of adding both overflow-x and overflow-y properties. RELATED TAGS. html....
Read more >
How To Create A Vertical Scrollbar In HTML - Part 1/2 - YouTube
You can add the default scrollbar very easily. If you want to modify your scrollbar, just add some additional CSS code as shown...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found