Flagsmith / Flagsmith/flagsmith

Button: add isLoading state to consolidate async-action pattern

Open
#7,384 2 comments 0 reactions 1 assignee Claimed by @talissoncosta View on GitHub
design-system front-end
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

`Button` has `isLoading` (spinner + auto-disable, shipped). #8126 adds `aria-busy`/`aria-live` and an optional `loadingLabel`.

Remaining: replace the hand-rolled `isSaving ? 'Updating' : ...` + manual `disabled` pattern with `isLoading` at these sites (grep `{isSaving ?`):

`CreateGroup`, `CreateProject`, `CreateWebhook`, `CreateAuditLogWebhook`, `CreateSegmentRulesTabForm`, `CreateRole`, `FeatureSettingsTab`, `SegmentOverridesTab`, `IdentitySaveFooter`, `FeatureUpdateSummary`, `CreateEnvironmentPage`, `EnvironmentSettingsPage`, `OrganisationInformation`, `ProjectInformation`

Open question: Button-as-link. 30 sites pass `href`, and `isLoading`/`disabled` mean nothing on an anchor. Candidate answer: split a `LinkButton` and drop `href` from `Button`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.