fix: review round 2 — Clear watch progress clears only the resume point, big view focus by the way it arrived, dialog name, reason tooltip, backfill locks
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
/** An unavailable control's props. With a reason it stays focusable (`aria-disabled`, which
|
||||
* `FocusSafeButton` keeps inert to a click, and the reason in its tooltip — DESIGN.md "Unavailable
|
||||
* with a reason stays focusable"); without one it is plainly off. */
|
||||
* `FocusSafeButton` keeps inert to a click, and the reason read out with its name; the caller shows
|
||||
* it in a tooltip — DESIGN.md "Unavailable with a reason stays focusable"); without one it is
|
||||
* plainly off. */
|
||||
export function unavailable(disabled: boolean | undefined, reason: string | undefined) {
|
||||
if (!disabled) return {};
|
||||
return reason ? { "aria-disabled": true as const } : { disabled: true };
|
||||
return reason
|
||||
? { "aria-disabled": true as const, "aria-description": reason }
|
||||
: { disabled: true };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user