Skip to content

Commit

Permalink
Merge pull request #32 from BloomBooks/BL14049_VertScroll
Browse files Browse the repository at this point in the history
fix: Get rid of erroneous vertical scrollbar (BL-14049) (#32)
  • Loading branch information
JohnThomson authored Nov 5, 2024
2 parents 6617964 + a1e7e29 commit 8648441
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bloompub-viewer",
"version": "1.2.1",
"version": "1.2.2",
"author": "Bloom Devs",
"description": "Viewer for Bloom Digital books",
"license": "MIT",
Expand Down
16 changes: 15 additions & 1 deletion src/renderer/Viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,21 @@ export const Viewer: React.FunctionComponent<{ zipFilePath: string }> = (
<div className="App">
{htmPath && (
<iframe
style={{ width: "100%", height: "100%", border: "none" }}
style={{
width: "100%",
height: "100%",
border: "none",
// For a reason I still don't understand, setting all heights to 100% gives us a vertical scrollbar.
// As far as I can tell, there is an electron bug causing it to add 4px to the height of the iframe.
// But the inspector says the iframe height is the same as its parent and content, as it should be.
// If you set the iframe height to `calc(100% - 4px)`, the scrollbar goes away, but the 4px white bar remains at the bottom.
// The following 5 lines work around this.
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
}}
src={iframeSource}
/>
)}
Expand Down

0 comments on commit 8648441

Please sign in to comment.