Hi,
On UserEditModalForm.tsx
there is a button:
<button
type="submit"
className="btn btn-primary"
data-kt-users-modal-action="submit"
disabled={isUserLoading || formik.isSubmitting || !formik.isValid || !formik.touched}
>
<span className="indicator-label">Submit</span>
{(formik.isSubmitting || isUserLoading) && (
<span className="indicator-progress">
Please wait...{" "}
<span className="spinner-border spinner-border-sm align-middle ms-2"></span>
</span>
)}
</button>
span
with the class indicator-progress
but it won't show up when I click the submit button._indicator.scss
://
// Indicator
//
.indicator-progress {
display: none;
[data-kt-indicator="on"] > & {
display: inline-block;
}
}
.indicator-label {
[data-kt-indicator="on"] > & {
display: none;
}
}
data-kt-indicator
anywhere else though.Thanks!
Hi,
Sorry for the later reply.
In our UserEditModalForm.tsx we are using a different loading approach, if you want to enable loading inside a button you can render button content conditionally as shown below.
const [loadingState, setLoadingState] = useState(false);
<button
type="submit"
className="btn btn-primary"
data-kt-indicator={ loadingState ? "on" : "off" }
>
{ !loadingState && <span className="indicator-label">Submit</span> }
{ loadingState && (
<span className="indicator-progress">
Please wait...{" "}
<span className="spinner-border spinner-border-sm align-middle ms-2"></span>
</span>
) }
</button>