diff --git a/src/components/Send/index.tsx b/src/components/Send/index.tsx index a1009931..1898219b 100644 --- a/src/components/Send/index.tsx +++ b/src/components/Send/index.tsx @@ -25,7 +25,7 @@ import { buildCoinjoinRequirementSummary } from '../../hooks/CoinjoinRequirement import { routes } from '../../constants/routes' import { JM_MINIMUM_MAKERS_DEFAULT } from '../../constants/config' -import { SATS, formatSats, isValidNumber } from '../../utils' +import { SATS, formatSats, isValidNumber, scrollToTop } from '../../utils' import { enhanceDirectPaymentErrorMessageIfNecessary, @@ -477,6 +477,8 @@ export default function Send({ wallet }: SendProps) { setIsSweep(false) form.reset() + + scrollToTop() } } } diff --git a/src/utils.ts b/src/utils.ts index de6d44cb..0f834e03 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -92,3 +92,5 @@ export const toSemVer = (raw?: string): SemVer => { raw, } } + +export const scrollToTop = () => window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })