Fix scroll: window.scrollTo(0) on Next/Prev — scrolls to top of page, not just element
This commit is contained in:
parent
92fdf55cd9
commit
1db3e7f368
1 changed files with 2 additions and 1 deletions
|
|
@ -232,7 +232,8 @@ useEffect(() => {
|
||||||
const safeNavigate = (targetIdx) => {
|
const safeNavigate = (targetIdx) => {
|
||||||
setCurrentIdx(targetIdx)
|
setCurrentIdx(targetIdx)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.querySelector('.question-card')?.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
// Scroll to top of page so user sees the full question from the start
|
||||||
|
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||||
}, 50)
|
}, 50)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue