fix: add top breathing room for current card
This commit is contained in:
@@ -228,7 +228,7 @@ export default function ProcessPurposePracticePage() {
|
|||||||
|
|
||||||
const deckTop = deck.getBoundingClientRect().top
|
const deckTop = deck.getBoundingClientRect().top
|
||||||
const cardTop = currentCard.getBoundingClientRect().top
|
const cardTop = currentCard.getBoundingClientRect().top
|
||||||
const targetTop = Math.max(deck.scrollTop + cardTop - deckTop - 12, 0)
|
const targetTop = Math.max(deck.scrollTop + cardTop - deckTop - 32, 0)
|
||||||
currentScrollLimitRef.current = targetTop
|
currentScrollLimitRef.current = targetTop
|
||||||
deck.scrollTo({ top: targetTop, behavior: 'smooth' })
|
deck.scrollTo({ top: targetTop, behavior: 'smooth' })
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user