Submit button avoid flicker on actionReload

This commit is contained in:
Kalle (Sendou) 2022-01-05 17:11:02 +02:00
parent 09545f97f0
commit 700ed935cc

View File

@ -23,8 +23,12 @@ export function SubmitButton(
}, [actionData]);
const isLoading = (): boolean => {
if (transition.type !== "actionSubmission") return false;
// is there an action happening at the moment?
if (!["actionSubmission", "actionReload"].includes(transition.type)) {
return false;
}
// is it the action of this submit button?
const _action = transition.submission?.formData.get("_action");
if (_action !== actionType) return false;