Skip to content

Conversation

@nicolethoen
Copy link
Contributor

What: Closes #7596

  • Tree view examples
  • Select examples
  • Navigation examples
  • Toggle group examples
  • Tab content examples
  • Page examples
  • Menu examples
  • Options menu examples
  • Masthead examples

Notes:

  • Page example pages include color contrast violations for which I implemented a quick fix, but also opened core issues to fix more permanently.
  • I noticed the Beta feature alert on beta components was throwing an a11y error about heading level and aria-labels on divs. I don't believe that Alerts need the generated aria-label on divs, since that aria label programmatically matches the pf-u-screen-reader text in the Alert title. I will address the heading level violation in the beta tag in org after this PR merges.

@patternfly-build
Copy link
Collaborator

patternfly-build commented Jun 23, 2022

@nicolethoen nicolethoen changed the title chore: fix various a11y violations in examples chore: fix various a11y violations in examples (2) Jun 23, 2022
@nicolethoen nicolethoen force-pushed the fix_site_a11y_violations_3 branch from ce4bbba to 2600e21 Compare June 24, 2022 12:36
@nicolethoen nicolethoen requested a review from andyyvo June 24, 2022 13:30
@andyyvo
Copy link
Contributor

andyyvo commented Jun 30, 2022

What I'm seeing that I want to point out to see if these are issues that should be addressed:

  • TabsContent
    • "ARIA attributes must conform to valid values."
    • Element location: #pf-tab-5-pf-1656602442774rgfe4heq02 (they all appear to be the ARIA Disabled (Tooltip) button)
  • Page
    • All 9 examples have "Main landmark should not be contained in another landmark."
    • Element #ws-page-main has two issues
      • "Document should not have more than one main landmark."
      • "Ensures landmarks are unique."

@nicolethoen
Copy link
Contributor Author

nicolethoen commented Jul 5, 2022

Thanks @andyyvo

  • TabsContent

    • "ARIA attributes must conform to valid values."
    • Element location: #pf-tab-5-pf-1656602442774rgfe4heq02 (they all appear to be the ARIA Disabled (Tooltip) button)

I'm not sure that I can do anything about these violations - right now, the violation is raising a 'needs review' warning (in my console). This is because the buttons are claiming to be labelled by tooltips which don't exist on the page (yet - until they are triggered to open). So I sort of decided that 'upon review' this was not really a problem. @thatblindgeye do you think that makes sense?

  • Page
    • All 9 examples have "Main landmark should not be contained in another landmark."

    • Element #ws-page-main has two issues

      • "Document should not have more than one main landmark."
      • "Ensures landmarks are unique."

I did notice that as well, and I made a note to ignore this violation whenever the report is run (bullet point number 5 in this issue).
The page component needs to have a 'main' element so by its nature, we will have multiple 'main' elements on the page examples. I don't see a way around that.

@thatblindgeye
Copy link
Contributor

I'm not sure that I can do anything about these violations - right now, the violation is raising a 'needs review' warning (in my console). This is because the buttons are claiming to be labelled by tooltips which don't exist on the page (yet - until they are triggered to open). So I sort of decided that 'upon review' this was not really a problem. @thatblindgeye do you think that makes sense?

That makes sense to me. It might be worth looking into in the future to avoid the error, but I'm also getting the "needs review" and "impact: unknown" on this issue in aXe. One quick work around could be to wrap the Tooltip in a div and give the div the id of "tooltip-ref1", but that would still be worth discussing if we wanted to update our recommended approach to that just for this aXe issue.

@nicolethoen nicolethoen requested review from jenny-s51 and kmcfaul and removed request for jenny-s51 July 6, 2022 13:55
@tlabaj tlabaj requested a review from jessiehuff July 6, 2022 18:48
@tlabaj tlabaj added the A11y label Jul 6, 2022
aria-hidden={!navOpen}
{...props}
>
<div className={styles.pageSidebarBody}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolethoen were the styles not getting applied correctly? @mattnolting or @mcoker can you verify everything is as expected .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class still looks like it's getting applied properly.

@@ -0,0 +1,3 @@
.pf-c-page__sidebar-body {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

Copy link
Contributor

@mcoker mcoker Jul 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to fix this "Navigation" text in the sidebar.

Screen Shot 2022-07-06 at 3 12 44 PM

We don't set the color of regular text in the sidebar since we don't have a use case for text there, so by default the "Navigation" text is our default/black text color and not visible. This local style makes it visible. @nicolethoen's fix is the same one I recommended to fix this issue in core - patternfly/patternfly#4920 (comment)

Though without a parent selector to limit this style to the page examples, will it apply to other .pf-c-page__sidebar-body elements in other examples after visiting the page component examples and loading this style? I don't know if that would cause an immediate issue, but it might lead to unexpected styles in other examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to what @mcoker said, I was just trying to fix the color contrast issue without adding extra components to the page examples - trying to keep them pure.

isPlain = false,
isLiveRegion = false,
variantLabel = `${capitalize(variant)} alert:`,
'aria-label': ariaLabel = `${capitalize(variant)} Alert`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily a blocker, but one pro for keeping this aria-label in is that, at least for VoiceOver, it announces "Info alert, group" and "end of info alert, group" when entering/exiting it. So possibly better context of what is actually considered part of the alert or not.

I would agree that I don't think we need both this aria-label and the variantLabel that prefaces the alert title, though, and if we would want to avoid that aXe error about aria-labels on divs then I'm on board with this change. Another option would be adding a role/changing the div, but I'm not sure what would be the best approach for this other than maybe a status role (though that will create a live region on alerts).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this was one where I was not sure which of the possible fixes were the best.
I opted for this because it's a single alert, not an alert group, so I thought that VO call out was not quite accurate.

Copy link
Contributor

@jessiehuff jessiehuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the alert discussion, I admit that I'm conflicted on it myself. I do think the aria-label can add extra context that it's an alert/block of info, but I'm not quite sure what role to give it. We could give it role="alert" but that typically turns it into a live region, and I don't know if that makes sense in all contexts/if it could create a double live region when used with AlertGroup. When users are including dynamic alerts, we currently recommend that they use an AlertGroup to contain them and that becomes the live region. So ideally this shouldn't be too big of an issue to remove the aria-label because the only time it should affect them is in static single alerts.

@nicolethoen nicolethoen force-pushed the fix_site_a11y_violations_3 branch from 2bb36fc to e33f668 Compare July 8, 2022 20:12
@thatblindgeye thatblindgeye merged commit a36eb83 into patternfly:main Jul 15, 2022
@patternfly-build
Copy link
Collaborator

Your changes have been released in:

  • eslint-plugin-patternfly-react@4.64.3
  • @patternfly/react-catalog-view-extension@4.76.3
  • @patternfly/react-charts@6.78.3
  • @patternfly/react-code-editor@4.66.3
  • @patternfly/react-console@4.76.3
  • @patternfly/react-core@4.225.3
  • @patternfly/react-docs@5.86.3
  • @patternfly/react-icons@4.76.3
  • @patternfly/react-inline-edit-extension@4.70.3
  • demo-app-ts@4.185.3
  • @patternfly/react-integration@4.187.3
  • @patternfly/react-log-viewer@4.70.3
  • @patternfly/react-styles@4.75.3
  • @patternfly/react-table@4.94.3
  • @patternfly/react-tokens@4.77.3
  • @patternfly/react-topology@4.72.3
  • @patternfly/react-virtualized-extension@4.72.3
  • transformer-cjs-imports@4.63.3

Thanks for your contribution! 🎉

jenny-s51 pushed a commit to jenny-s51/patternfly-react that referenced this pull request Jul 26, 2022
@nicolethoen nicolethoen deleted the fix_site_a11y_violations_3 branch February 8, 2023 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: address a11y violations from various component docs (2)

9 participants