Skip to content

Commit

Permalink
Create new scroll target for top of payment section
Browse files Browse the repository at this point in the history
- this will prevent content from getting overlapped by the navigation bar

https://phabricator.wikimedia.org/T368525
  • Loading branch information
moiikana committed Sep 19, 2024
1 parent d8ab241 commit cd446b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>
<ScrollTarget target-id="payment-section-top-scroll-target"/>
<div
id="donation-page-form-section-payment"
class="donation-page-form-section"
Expand All @@ -22,6 +23,7 @@

<script setup lang="ts">
import Payment from '@src/components/pages/donation_form/Payment.vue';
import ScrollTarget from '@src/components/shared/ScrollTarget.vue';
interface Props {
paymentAmounts: number[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const setFullSelected = ( selected: boolean ) => {
};
const scrollToPaymentSection = () => {
const scrollIntoViewElement = document.getElementById( 'donation-page-form-section-payment' );
const scrollIntoViewElement = document.getElementById( 'payment-section-top-scroll-target' );
if ( scrollIntoViewElement ) {
scrollIntoViewElement.scrollIntoView( { behavior: 'smooth' } );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const mailingList = useMailingListModel( store );
const { receiptNeeded, showReceiptOptionError } = useReceiptModel( store );
const countryWasRestored = ref<boolean>( false );
const scrollToPaymentSection = () => {
const scrollIntoViewElement = document.getElementById( 'donation-page-form-section-payment' );
const scrollIntoViewElement = document.getElementById( 'payment-section-top-scroll-target' );
if ( scrollIntoViewElement ) {
scrollIntoViewElement.scrollIntoView( { behavior: 'smooth' } );
}
Expand Down

0 comments on commit cd446b6

Please sign in to comment.