feat(SW-718) refactor: optimize rate selection and room scrolling

This commit is contained in:
Pontus Dreij
2025-01-28 18:33:10 +01:00
parent ab7b826cd2
commit eef7c222aa
4 changed files with 11 additions and 8 deletions

View File

@@ -193,7 +193,7 @@ export default function Rooms({
}
useEffect(() => {
setTimeout(() => {
requestAnimationFrame(() => {
const SCROLL_OFFSET = 100
const roomElements = document.querySelectorAll(`.${styles.roomContainer}`)
const index = selectedRates.findIndex((rate) => rate === undefined)
@@ -208,7 +208,7 @@ export default function Rooms({
behavior: "smooth",
})
}
}, 0)
})
}, [selectedRates])
return (