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(() => {
|
||||
const SCROLL_OFFSET = 173 // summary on mobile is 163px
|
||||
|
||||
const selectedRateCard: HTMLElement | null = document.querySelector(
|
||||
`.${styles.roomList} label:has(input[type=radio]:checked)`
|
||||
const checkedRadio = document.querySelector(
|
||||
`.${styles.roomList} input[type="radio"]:checked`
|
||||
)
|
||||
|
||||
const selectedRateCard = checkedRadio?.closest("label") ?? null
|
||||
|
||||
if (selectedRateCard) {
|
||||
const elementPosition = selectedRateCard.getBoundingClientRect().top
|
||||
const windowHeight = window.innerHeight
|
||||
|
||||
Reference in New Issue
Block a user