@stenajs-webui/elements 23.21.15 → 23.21.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,16 +4,24 @@ import { CommonButtonProps } from "./ButtonCommon";
4
4
  export interface BaseButtonProps extends CommonButtonProps, ButtonElementProps {
5
5
  forceRound?: boolean;
6
6
  /**
7
- * Looks and announces as disabled, but stays in the tab order.
7
+ * Looks and announces as disabled, but stays in the tab order and still
8
+ * calls onClick.
8
9
  *
9
- * A button with the disabled attribute cannot be focused, so a keyboard user
10
- * never reaches it and is never told it is there. This renders an enabled
11
- * button carrying aria-disabled, which screen readers announce as dimmed
12
- * while leaving it reachable, and suppresses activation so that it does
13
- * nothing when pressed.
10
+ * A button with the disabled attribute cannot be focused and does nothing
11
+ * when pressed, so a keyboard user never reaches it and no one can find out
12
+ * why it is unavailable. This renders an ordinary, working button that is
13
+ * styled as disabled and carries aria-disabled, which screen readers
14
+ * announce as dimmed.
14
15
  *
15
- * Prefer it over disabled when the user needs to find out why the button
16
- * cannot be used, such as when it carries a tooltip explaining itself.
16
+ * The click is the point: it is what lets the button explain itself, by
17
+ * revealing the errors that are blocking it, or opening the thing that has
18
+ * to be filled in first. Give it an onClick that says why rather than one
19
+ * that goes ahead and does the thing the button looks unable to do.
20
+ *
21
+ * It is an ordinary button in every other way, so a type="submit" one with
22
+ * no onClick of its own still submits its form.
23
+ *
24
+ * Use disabled instead when the button really should do nothing at all.
17
25
  */
18
26
  visuallyDisabled?: boolean;
19
27
  }