Skip to content

Commit

Permalink
Make element scrollable after clicking next
Browse files Browse the repository at this point in the history
  • Loading branch information
kattylucy committed Dec 19, 2024
1 parent 254503b commit bc6ac0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export const PoolSetupSection = () => {
useEffect(() => {
form.setFieldValue('adminMultisig.signers[0]', selectedAccount?.address)
}, [])

Check warning on line 69 in centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx

View workflow job for this annotation

GitHub Actions / app-pr-deploy / build-app

React Hook useEffect has missing dependencies: 'form' and 'selectedAccount?.address'. Either include them or remove the dependency array
console.log(values)
return (
<Box>
<Text variant="heading2" fontWeight={700}>
Expand Down
11 changes: 9 additions & 2 deletions centrifuge-app/src/pages/IssuerCreatePool/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const txMessage = {
const IssuerCreatePoolPage = () => {
const theme = useTheme()
const formRef = useRef<HTMLFormElement>(null)
const containerRef = useRef<HTMLDivElement>(null)
const isSmall = useIsAboveBreakpoint('S')
const address = useAddress('substrate')
const navigate = useNavigate()
Expand Down Expand Up @@ -451,8 +452,14 @@ const IssuerCreatePoolPage = () => {
}))
}, [values, errors, step, stepFields])

Check warning on line 453 in centrifuge-app/src/pages/IssuerCreatePool/index.tsx

View workflow job for this annotation

GitHub Actions / app-pr-deploy / build-app

React Hook useEffect has a missing dependency: 'checkStepCompletion'. Either include it or remove the dependency array. Outer scope values like 'stepFields' aren't valid dependencies because mutating them doesn't re-render the component

useEffect(() => {
if (containerRef.current && step !== 3) {
containerRef.current.scrollTo({ top: 0, behavior: 'smooth' })
}
}, [step, containerRef])

return (
<>
<div ref={containerRef} style={{ maxHeight: '100vh', overflowY: 'auto' }}>
<PreimageHashDialog
preimageHash={preimageHash}
open={isPreimageDialogOpen}
Expand Down Expand Up @@ -540,7 +547,7 @@ const IssuerCreatePoolPage = () => {
</Box>
</Dialog>
)}
</>
</div>
)
}

Expand Down

0 comments on commit bc6ac0c

Please sign in to comment.