Commit 78b2b6ed authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed firefox scrollbars and resizing issues with archive browser. #426

parent 34005e1a
Pipeline #83248 passed with stages
in 20 minutes and 44 seconds
...@@ -42,7 +42,7 @@ const useBrowserStyles = makeStyles(theme => ({ ...@@ -42,7 +42,7 @@ const useBrowserStyles = makeStyles(theme => ({
scrollBehavior: 'smooth' scrollBehavior: 'smooth'
}, },
lanes: { lanes: {
display: 'table', display: 'flex',
overflow: 'scroll', overflow: 'scroll',
height: '100%', height: '100%',
overflowY: 'hidden', overflowY: 'hidden',
...@@ -56,10 +56,15 @@ export default function Browser({adaptor, form}) { ...@@ -56,10 +56,15 @@ export default function Browser({adaptor, form}) {
const innerRef = useRef() const innerRef = useRef()
useLayoutEffect(() => { useLayoutEffect(() => {
function update() {
const height = window.innerHeight - outerRef.current.getBoundingClientRect().top - 24 const height = window.innerHeight - outerRef.current.getBoundingClientRect().top - 24
rootRef.current.style.height = `${height}px` rootRef.current.style.height = `${height}px`
const scrollAmmount = innerRef.current.clientWidth - outerRef.current.clientWidth const scrollAmmount = innerRef.current.clientWidth - outerRef.current.clientWidth
outerRef.current.scrollLeft = Math.max(scrollAmmount, 0) outerRef.current.scrollLeft = Math.max(scrollAmmount, 0)
}
update()
window.addEventListener('resize', update)
return () => window.removeEventListener('resize', update)
}) })
const { pathname } = useLocation() const { pathname } = useLocation()
...@@ -113,7 +118,7 @@ const useLaneStyles = makeStyles(theme => ({ ...@@ -113,7 +118,7 @@ const useLaneStyles = makeStyles(theme => ({
minWidth: 200, minWidth: 200,
maxWidth: 512, maxWidth: 512,
borderRight: `solid 1px ${grey[500]}`, borderRight: `solid 1px ${grey[500]}`,
display: 'table-cell' display: 'block'
}, },
container: { container: {
display: 'block', display: 'block',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment