WIP: add TODO and small fixies
This commit is contained in:
@@ -54,7 +54,15 @@ export const useUiStore = defineStore('ui', {
|
||||
const boxElement = document.getElementById(box.id)
|
||||
if (boxElement) {
|
||||
setTimeout(() => {
|
||||
boxElement.scrollIntoView({ behavior: 'smooth' })
|
||||
// Récupérer la position de l'élément
|
||||
const elementRect = boxElement.getBoundingClientRect()
|
||||
// Calculer la position de défilement (une boîte plus haut)
|
||||
const offsetPosition = elementRect.top + window.pageYOffset - (elementRect.height * 1.5)
|
||||
// Faire défiler à la nouvelle position
|
||||
window.scrollTo({
|
||||
top: offsetPosition,
|
||||
behavior: 'smooth'
|
||||
})
|
||||
}, 333)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user