1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 09:44:53 +01:00

move user's focus to top of screen upon publish

This commit is contained in:
Matthias Kretschmann 2020-10-05 15:40:01 +02:00
parent fb095460ab
commit 2c2bf3cef1
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -74,6 +74,9 @@ export default function PublishPage({
initialStatus="empty" initialStatus="empty"
validationSchema={validationSchema} validationSchema={validationSchema}
onSubmit={async (values, { setSubmitting, resetForm }) => { onSubmit={async (values, { setSubmitting, resetForm }) => {
// move user's focus to top of screen
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
// kick off publishing
await handleSubmit(values, resetForm) await handleSubmit(values, resetForm)
setSubmitting(false) setSubmitting(false)
}} }}