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 1232650
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)
}, [])
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])

useEffect(() => {
if (containerRef.current) {
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 1232650

Please sign in to comment.