diff --git a/src/components/common/navigation/component.js b/src/components/common/navigation/component.js index f3ae0d87f..c8c7c494b 100644 --- a/src/components/common/navigation/component.js +++ b/src/components/common/navigation/component.js @@ -70,7 +70,7 @@ const Navigation = ({ location, textSearch, setTextSearch, version, setOpenDrawe return ( <> - + { }; const scrollTo = ref => { - ref.current.scrollIntoView({ behavior: 'smooth' }); + // headers element are 13.5 em high, 'normal' fontSize is 14px + const { offsetTop } = ref.current; + const fontSize = getComputedStyle(ref.current)['font-style']; + const fontValue = fontSize === 'normal' ? 14 : fontSize; + const topValue = parseFloat(offsetTop - fontValue * 13.5); + window.scrollTo({ behavior: 'smooth', top: topValue }); }; const transmit = async () => { diff --git a/src/components/panel-body/UEpage/router.js b/src/components/panel-body/UEpage/router.js index 9b0d7ee58..8f496e15c 100644 --- a/src/components/panel-body/UEpage/router.js +++ b/src/components/panel-body/UEpage/router.js @@ -15,7 +15,7 @@ import UeSubInfoTile from './ueSubInfoTile'; const useStyles = makeStyles(() => ({ ajustScroll: { - height: 'calc(100vh - 3em)', + height: 'calc(100vh - 13.5em)', }, modal: { display: 'flex', @@ -30,7 +30,6 @@ const useStyles = makeStyles(() => ({ boxShadow: 'unset', backgroundColor: 'transparent', }, - topSticky: { position: 'sticky', top: '0px' }, })); const Router = ({ match, saveUE, refresh }) => { @@ -85,7 +84,7 @@ const Router = ({ match, saveUE, refresh }) => { return ( <> -
+
diff --git a/src/components/panel-body/UEpage/stateLine.js b/src/components/panel-body/UEpage/stateLine.js index bd71ee2a4..132116b84 100644 --- a/src/components/panel-body/UEpage/stateLine.js +++ b/src/components/panel-body/UEpage/stateLine.js @@ -30,7 +30,7 @@ const StateLine = () => { height: 'max-content', backgroundColor: theme.palette.primary.main, position: 'sticky', - top: '6em', + top: '5em', }, })); const classes = useStyles(); diff --git a/src/components/panel-body/UEpage/ueSubInfoTile.js b/src/components/panel-body/UEpage/ueSubInfoTile.js index c131b8e06..4e8106991 100644 --- a/src/components/panel-body/UEpage/ueSubInfoTile.js +++ b/src/components/panel-body/UEpage/ueSubInfoTile.js @@ -11,7 +11,6 @@ const useStyles = makeStyles(() => ({ scrollMarginTop: '3em', padding: '1em', borderRadius: '15px', - minHeight: '400px', }, })); diff --git a/src/components/panel-body/home/component.js b/src/components/panel-body/home/component.js index e408a9daf..0894abf35 100644 --- a/src/components/panel-body/home/component.js +++ b/src/components/panel-body/home/component.js @@ -12,7 +12,7 @@ const Home = ({ location, match }) => { const [openDrawer, setOpenDrawer] = useState(false); return ( -
+