Skip to content

Commit

Permalink
Make Scroller 100% width
Browse files Browse the repository at this point in the history
  • Loading branch information
pomber committed Mar 19, 2019
1 parent f0af986 commit 86f8a4c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
22 changes: 19 additions & 3 deletions src/scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ export default function Scroller({

return (
<div
style={{ height: "100%", overflowY: "auto", overflowX: "hidden" }}
style={{
height: "100%",
overflowY: "auto",
overflowX: "hidden"
}}
className="scroller"
ref={ref}
onScroll={e => {
Expand All @@ -155,8 +159,20 @@ export default function Scroller({
}
dispatch({ type: "manual-scroll", newTop });
}}
children={children}
/>
>
<code
style={{
display: "block",
width: "calc(100% - 20px)",
maxWidth: "900px",
margin: "auto",
padding: "10px",
boxSizing: "border-box",
height: "100%"
}}
children={children}
/>
</div>
);
}

Expand Down
26 changes: 7 additions & 19 deletions src/slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,13 @@ function Slide({ lines, styles, changes }) {
boxSizing: "border-box"
}}
>
<code
style={{
display: "block",
width: "calc(100% - 20px)",
maxWidth: "900px",
margin: "auto",
padding: "10px",
height: "100%",
boxSizing: "border-box"
}}
>
<Scroller
items={lines}
getRow={getLine}
getRowHeight={getLineHeight}
data={{ styles }}
snapAreas={changes}
/>
</code>
<Scroller
items={lines}
getRow={getLine}
getRowHeight={getLineHeight}
data={{ styles }}
snapAreas={changes}
/>
</pre>
);
}
Expand Down

0 comments on commit 86f8a4c

Please sign in to comment.