-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent double click on form submission #173
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
if (isSubmitting) { | ||
return <LoadingPage title={t('activities.form.submitting')} /> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand why you added a loader here.
Wouldn't this cause "blinking" on the screen?
User clicks on form submit button
-> Page abruptly changes to loading
Activity completed, now waiting for next activity
-> Page abruptly changes to loading again
Form Activity loaded
Fetching form
-> Page abruptly changes to loading again
Form fetched
I would've expected a loader on the "Submit" button (disable button, show a spinner) than showing a loader on the full page. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Added a minor suggestion, can be tackled later as well.
if (isSubmitting) { | ||
return <LoadingPage title={t('activities.form.submitting')} /> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this approach. Would prefer if we disabled the submit button on the form component itself while isSubmitting is true. I recognise this means you need to add a prop and handle this in the different form UI components but a layout-level loading page is overkill for a activity-level piece of state
Blocking, double-click on form submission and add submitting form load screen