Repository navigation
Title: [Button]: add loading state #791
Description
Problem
ButtonComponent ([tedi-button]) has no loading state. A button that starts a request, for example "Load more" below a list, has to block repeated clicks while the request runs. The only built-in way is disabled, which removes the button from the tab order: keyboard focus falls to <body> and a screen-reader user loses their place (WCAG 2.4.3).
aria-disabled="true" keeps the focus, but TEDI does not style it. .tedi-button:disabled is the only disabled rule, so an aria-disabled button keeps its normal and hover colours, and each app imitates the disabled look with its own CSS.
The React library already has this: Button takes isLoading, which sets aria-disabled and aria-busy, shows a spinner, and ignores clicks while the button stays focusable (TEDI-Design-System/react#763).
Solution
Add a loading input to ButtonComponent, matching React's isLoading:
- sets
aria-disabled="true"andaria-busy="true"on the host; - applies the disabled colours (
--button-main-disabled-*) andcursor: not-allowed, without hover and active styles; - keeps the button focusable, with the visible focus outline;
- a click while loading does not reach the consumer's
(click)handler, or the documentation states that the consumer ignores it.
Project
SFOS
DoD
- The component is developed using best practices, conventions, and modern frontend trends
- The component follows BEM naming conventions (if applicable)
- The component implementation matches the Figma design, including all defined states and interactions
- The component supports responsiveness and scales across breakpoints (if applicable)
- The component does not introduce runtime errors or warnings
- Linter passes
- The component is exported from its tier barrel
- The component has unit tests with at least 80% code coverage (enforced by the global Jest
coverageThresholdovertedi/components, not per component) - CodeCov passes its threshold (80% on the changed code, with 10% tolerance — a separate gate from the Jest one above)
- The component has passed code review
- The component has passed Chromatic visual review
- Storybook stories are created:
- Cover all Figma variations
- Include edge cases, empty/error states
- Component’s API (props, slots, events) is documented
- ZeroHeight is updated with design/development guidelines
- External dependencies used in the component are documented in Storybook and Zeroheight, with rationale
- Semantic commit format
type(scope): Subject text #issue-refis used (forsemantic-release), with the issue reference required - see Commit convention - External libraries comply with validated open source licenses
- Component is versioned correctly and ready for release if required
- Update the Angular development status on the statuses page in Zeroheight
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity