Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClipboardCopy only needs aria-label when empty #1244

Commits on Jul 29, 2022

  1. ClipboardCopy only needs aria-label when empty

    We were requiring `aria-label` on ClipboardCopy in all cases, but when
    the component already contains suitable text this is not recommended.
    
    This changes when we validate the presence of `aria-label`. At
    instantiation time the component doesn't know if it will be rendered
    with a block, so we check at render time instead.
    
    Fixes primer#1081
    neall committed Jul 29, 2022
    Configuration menu
    Copy the full SHA
    cc7d5e7 View commit details
    Browse the repository at this point in the history
  2. All ClipboardCopy without content needs aria-label

    I was just checking for a block to decide if ClipboardCopy needed an
    aria-label. But @camertron suggested that checking for blank content
    would be better, and I think the code is nicer as well.
    neall committed Jul 29, 2022
    Configuration menu
    Copy the full SHA
    0a5cb86 View commit details
    Browse the repository at this point in the history
  3. Fill my intentionally empty block for RuboCop

    An explicit nil tests just as well while satisfying the linter.
    neall committed Jul 29, 2022
    Configuration menu
    Copy the full SHA
    88bb2d4 View commit details
    Browse the repository at this point in the history