swarm-ui try-out: stable live region, reasons for disabled buttons
The running line is a live region whose text changed every second, so a screen reader announced the counter again each time. The sentence is now stable and the elapsed seconds sit outside it. The run and open-a-PR buttons point at the hint that says why they are off, and add-a-classification says why it is off at the cap.
This commit is contained in:
parent
e81aaef7e3
commit
e03bd4caa4
1 changed files with 53 additions and 11 deletions
|
|
@ -14,12 +14,15 @@ export function Button({
|
|||
type = "button",
|
||||
disabled,
|
||||
onClick,
|
||||
describedBy,
|
||||
children,
|
||||
}: {
|
||||
variant?: ButtonVariant;
|
||||
type?: "button" | "submit";
|
||||
disabled?: boolean;
|
||||
onClick?: (e: Event) => void;
|
||||
/** Id of the element that says why the button is disabled. */
|
||||
describedBy?: string;
|
||||
children: ComponentChildren;
|
||||
}) {
|
||||
return (
|
||||
|
|
@ -28,6 +31,7 @@ export function Button({
|
|||
type={type}
|
||||
disabled={disabled}
|
||||
onClick={onClick}
|
||||
aria-describedby={describedBy}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
|
|
|
|||
Loading…
Reference in a new issue