• Robert Knight's avatar
    Do not set "aria-pressed" attribute for non-toggle buttons · fd927d6b
    Robert Knight authored
    Setting the `aria-pressed` attribute on a button indicates to assistive
    technology that it is a toggle button. Because the `Button` component
    always set this attribute and the `isActive` prop had a default value of
    false, this meant that every `Button` in the UI was identified as a
    toggle button by screen readers.
    
    Fix the issue by renaming `isActive` to `isPressed` and aligning it with
    the behavior of `aria-pressed`:
    
     - If `true`, the button is a pressed toggle button
     - If `false`, the button is a non-pressed toggle button
     - If undefined, the button is a regular button and `aria-pressed` is
       not set
    fd927d6b
button.js 4.22 KB