-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(feedback): Disable Feedback submit & cancel buttons while submitting #15408
feat(feedback): Disable Feedback submit & cancel buttons while submitting #15408
Conversation
size-limit report 📦
|
actually, i'm going to see if i can easily disable the whole form, or all the controls inside it instead of only 2 buttons. |
await waitForSec(5); | ||
|
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.
What's this for?
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.
d'oh
for testing
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.
speedup loop
@@ -146,7 +148,7 @@ export function Form({ | |||
<ScreenshotInputComponent onError={onScreenshotError} /> | |||
) : null} | |||
|
|||
<div class="form__right" data-sentry-feedback={true}> | |||
<fieldset class="form__right" data-sentry-feedback={true} disabled={isSubmitting}> |
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.
what does fieldset do?
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.
it's a container for form controls. it's got some default padding&margin and a border too.
the reason that i brought it in is because it supports disabled
which will prevent the text boxes from accepting input.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset#attributes
It's not applying to our <button>
inside the form tho, so i had to do those manually. I suspect, but didn't test, that it would automatically disable <input type="button"> or
` if we were using those instead. But i don't wanna change it all over.
While submitting feedback the Submit and Cancel buttons previously remained active. So you could smash that submit many times and submit many duplicate feedbacks.
This disabled the buttons while the network request is being fired off.
The disabled buttons are slightly grayed out by the browser. So it depends on what custom color you've picked:
