Skip to content

Commit

Permalink
III-5848 - Add scroll to additionalInformationStep on OrganizersForm
Browse files Browse the repository at this point in the history
  • Loading branch information
brampauwelyn committed Oct 12, 2023
1 parent edf8e95 commit 9daabdc
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { FC, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useQueryClient } from 'react-query';

import { OfferType, Scope, ScopeTypes } from '@/constants/OfferType';
import {
OfferType,
OfferTypes,
Scope,
ScopeTypes,
} from '@/constants/OfferType';
import { useIntersectionObserver } from '@/hooks/useIntersectionObserver';
import { CultuurKuurStep } from '@/pages/steps/AdditionalInformationStep/CultuurKuurStep';
import { LabelsStep } from '@/pages/steps/AdditionalInformationStep/LabelsStep';
Expand Down Expand Up @@ -244,6 +249,10 @@ const AdditionalInformationStep = ({
};

useEffect(() => {
if (scope === ScopeTypes.ORGANIZERS) {
handleScroll();
}

if (!hash || !Object.values(Fields).some((field) => hash === field)) return;
setTab(hash);
handleScroll();
Expand Down Expand Up @@ -313,7 +322,9 @@ const AdditionalInformationStep = ({
}
>
<TabContent
minHeight="450px"
minHeight={
scope === ScopeTypes.ORGANIZERS ? '600px' : '450px'
}
offerId={offerId}
scope={scope}
onValidationChange={(status) => {
Expand Down

0 comments on commit 9daabdc

Please sign in to comment.