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

Remove role image for decorative (ariaHidden=true) icon #252

Closed
hadasfa opened this issue Oct 11, 2021 · 4 comments
Closed

Remove role image for decorative (ariaHidden=true) icon #252

hadasfa opened this issue Oct 11, 2021 · 4 comments
Assignees
Labels

Comments

@hadasfa
Copy link
Contributor

hadasfa commented Oct 11, 2021

Remove the role: "image" attribute from the icon component when the value of the prop ariaHidden is true.
This prop is passed as part of the props inside screenReaderAccessProps which calculate in the hook "useIconScreenReaderAccessProps."

@ozer550
Copy link

ozer550 commented Oct 11, 2021

Hi, I would like to work on this issue. I'm new to opensource :)

@ozer550
Copy link

ozer550 commented Oct 11, 2021

Sorry, but I can't quite properly understand what I have to do can someone guide me?

@Mihir50
Copy link
Contributor

Mihir50 commented Oct 12, 2021

Should I change the role here?

export function getIconScreenReaderAccessProps({ isClickable, isDecorationOnly, isKeyboardAccessible, label }) {
  const overrideIsDecorationOnly = isNil(isDecorationOnly) ? !isClickable : isDecorationOnly;
  if (isClickable)
    return getClickableIconScreenReaderAccessProps({
      label,
      isDecorationOnly: overrideIsDecorationOnly,
      isKeyboardAccessible
    });
  return {
    role: "img",
    "aria-hidden": overrideIsDecorationOnly,
    tabIndex: undefined,
    "aria-label": isDecorationOnly ? undefined : label
  };
}

@hadasfa
Copy link
Contributor Author

hadasfa commented Oct 12, 2021

@Mihir50 exactly

@hadasfa hadasfa closed this as completed Oct 13, 2021
talkor pushed a commit that referenced this issue Feb 13, 2024
* Fix preview file TS issue

* Upgrade storybook packages to ^7.5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants