Fix scroll bug after push
This commit is contained in:
@@ -44,7 +44,7 @@ export default function MizikBadjMeni({miziks}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleClick = slug => {
|
const handleClick = slug => {
|
||||||
router.push(`/teks/${slug}#${slug}`)
|
router.push(`/teks/${slug}#${slug}`).then(() => window.scrollTo(0, 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleListKeyDown(event) {
|
function handleListKeyDown(event) {
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ export default function MizikLis({setMobileOpen, hasAwtis, miziks, selectedMizik
|
|||||||
|
|
||||||
if (slug !== selectedMizikSlug) {
|
if (slug !== selectedMizikSlug) {
|
||||||
if (hasAwtis) {
|
if (hasAwtis) {
|
||||||
router.push(`/teks/${slug}`)
|
router.push(`/teks/${slug}`).then(() => window.scrollTo(0, 0))
|
||||||
} else {
|
} else {
|
||||||
router.push(`/teks/${slug}#${slug}`)
|
router.push(`/teks/${slug}#${slug}`).then(() => window.scrollTo(0, 0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default function KatKayLa({tit, kombyen, route}) {
|
|||||||
return (
|
return (
|
||||||
<Grid item sm>
|
<Grid item sm>
|
||||||
<Card className={classes.root} variant='outlined'>
|
<Card className={classes.root} variant='outlined'>
|
||||||
<CardActionArea onClick={() => router.push(route)}>
|
<CardActionArea onClick={() => router.push(route).then(() => window.scrollTo(0, 0))}>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Typography gutterBottom align='center' variant='h3' component='h1'>
|
<Typography gutterBottom align='center' variant='h3' component='h1'>
|
||||||
{tit}
|
{tit}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export default function Navigasyon({selectedTab}) {
|
|||||||
setValue(newValue)
|
setValue(newValue)
|
||||||
|
|
||||||
if (newValue !== selectedTab) {
|
if (newValue !== selectedTab) {
|
||||||
router.push(tabRouteHref[newValue], tabRouteAs[newValue])
|
router.push(tabRouteHref[newValue], tabRouteAs[newValue]).then(() => window.scrollTo(0, 0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default function TeksKat({teks}) {
|
|||||||
const datPiblikasyon = format(new Date(published_at), 'Pp', {locale: fr})
|
const datPiblikasyon = format(new Date(published_at), 'Pp', {locale: fr})
|
||||||
|
|
||||||
const handleClick = slug => {
|
const handleClick = slug => {
|
||||||
router.push(`/teks/${slug}#${slug}`)
|
router.push(`/teks/${slug}#${slug}`).then(() => window.scrollTo(0, 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user