Uh oh!
There was an error while loading. Please reload this page.
feat(feedback): Disable Feedback submit & cancel buttons while submitting - #15408
Conversation
size-limit report 📦
|
ryan953
commented
Feb 13, 2025
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); | ||
| ) : 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.
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:
