Merged in feat/book-395-queryselector (pull request #2870)
feat(BOOK-395): fixed error in queryselector * feat(BOOK-395): fixed error in queryselector Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -28,10 +28,12 @@ export default function ScrollToList() {
|
|||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
const SCROLL_OFFSET = 173 // summary on mobile is 163px
|
const SCROLL_OFFSET = 173 // summary on mobile is 163px
|
||||||
|
|
||||||
const selectedRateCard: HTMLElement | null = document.querySelector(
|
const checkedRadio = document.querySelector(
|
||||||
`.${styles.roomList} label:has(input[type=radio]:checked)`
|
`.${styles.roomList} input[type="radio"]:checked`
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const selectedRateCard = checkedRadio?.closest("label") ?? null
|
||||||
|
|
||||||
if (selectedRateCard) {
|
if (selectedRateCard) {
|
||||||
const elementPosition = selectedRateCard.getBoundingClientRect().top
|
const elementPosition = selectedRateCard.getBoundingClientRect().top
|
||||||
const windowHeight = window.innerHeight
|
const windowHeight = window.innerHeight
|
||||||
|
|||||||
Reference in New Issue
Block a user