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

[5.2] Fix a11y issue in accordion (role) #40578

Merged
merged 5 commits into from
Jan 19, 2025

Conversation

chmst
Copy link
Contributor

@chmst chmst commented May 12, 2023

Pull Request for Issue # .
The issue was mentioned in JAT channel by @rytechsites. Thanks for reporting. Replaces #40572

Summary of Changes

This PR removes the role attribute from bootstrap accordion. Thanks @drmenzelit.

Testing Instructions

Add a few page breaks into an article, set the layout in the page break plugin to "slider".
Check the result with an a11y tool.

Similar for menu item types modal or other occurrences of accordions

Actual result BEFORE applying this Pull Request

You will get a11y issues for the role attribute.

Expected result AFTER applying this Pull Request

No a11y issues.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@chmst chmst added a11y Accessibility Small A PR which only has a small change labels May 12, 2023
@obuisard obuisard added this to the Joomla! 4.3.2 milestone May 12, 2023
@brianteeman
Copy link
Contributor

Not at a pc but I am fairly certain that this is not correct as the code is used in many places where it is correct. Can a layout override not be created for the specific issue and not be so generic as this is

@chmst
Copy link
Contributor Author

chmst commented May 12, 2023

AXE and other tools mark this as an issue not only for pagebreak but also on other places, for example in menuitem type modal. See also https://www.w3.org/WAI/ARIA/apg/patterns/accordion/examples/accordion/

We found another issue in this bootstrap method, but it is not in scope of this PR.

@brianteeman
Copy link
Contributor

You are absolutely correct that the slider should not have any roles.

The problem, as I suspected, is that the bootstrap accordion is used in other places where it is absolutely correct for it to have the roles we have specified. The main example of this in the core is the mobile display in the admin of the options page. This uses the bootstrap accordion to display the tabs vertically and collapsed. This view is correctly using role=tab etc.

Please update this PR to not update the accorsdion in th library but to just correct the output of only the pagebreak slider.

I am currently at JoomlaDagen and have verified this with one of the leading accessibility consultants in the Netherlands.

@drmenzelit
Copy link
Contributor

The function addSlide in the library Bootstrap.php is being used only on four places:
administrator\components\com_finder\src\Service\HTML\Filter.php
administrator\components\com_menus\tmpl\menutypes\default.php
components\com_config\tmpl\modules\default_options.php
plugins\content\pagebreak\pagebreak.php
all having the same issues.

@chmst
Copy link
Contributor Author

chmst commented May 13, 2023

The bootstrap accordion itself is correct. But the code generated in the Helper is wrong.

@hans2103
Copy link
Contributor

@chmst I've added two page breaks to article = Typography and changed the setting of page-break plugin to sliders.
The JooA11y plugin does not notice a failure on the page.

Scherm­afbeelding 2023-05-15 om 16 13 50

@chmst
Copy link
Contributor Author

chmst commented May 20, 2023

@hans2103 jooa11y discovers only some rules like missing alt texts, coloour contrast issues for example, but not all issues.

Use another tool and you get this:
grafik

Interesting: different Tools find different issues. In this accordion alsió the expanded attribute is wrong.

@brianteeman said that he found a better solution. Looking forward ...

@obuisard obuisard removed this from the Joomla! 4.3.2 milestone May 21, 2023
@richard67 richard67 added the bug label May 21, 2023
@HLeithner HLeithner changed the base branch from 4.3-dev to 4.4-dev September 30, 2023 22:43
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 4.4-dev.

@drmenzelit drmenzelit self-assigned this Oct 24, 2023
@brianteeman
Copy link
Contributor

@brianteeman said that he found a better solution. Looking forward ...

I did?

@HLeithner HLeithner changed the title [4.3] Fix a11y issue in accordion (role) [4.4] Fix a11y issue in accordion (role) Apr 24, 2024
@HLeithner HLeithner changed the base branch from 4.4-dev to 5.2-dev November 15, 2024 13:21
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.2-dev.

@HLeithner HLeithner changed the title [4.4] Fix a11y issue in accordion (role) [5.2] Fix a11y issue in accordion (role) Nov 15, 2024
@softforge
Copy link
Contributor

I have tested this item ✅ successfully on 29111d5

The role was removed once the patch applied in the area suggested.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40578.

@Bodge-IT
Copy link

I have tested this item ✅ successfully on 29111d5

Tested this, for the accordion only. Noticed an empty space left before closing button tag, where role was declared.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40578.

@alikon
Copy link
Contributor

alikon commented Nov 27, 2024

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40578.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Nov 27, 2024
@brianteeman
Copy link
Contributor

#40578 (comment)

@Quy Quy added PR-4.4-dev and removed RTC This Pull Request is Ready To Commit PR-5.2-dev labels Nov 27, 2024
@chmst
Copy link
Contributor Author

chmst commented Nov 28, 2024

I chcked this again and again, in backend, with every device, with modals and option panel but cannot see where the role is needed.

@brianteeman
Copy link
Contributor

ARIA: tabpanel role
The ARIA tabpanel is a container for the resources of layered content associated with a tab.

The tabpanel role indicates the element is a container for the resources associated with a tab role, where each tab is contained in a tablist.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tabpanel_role#description)

image

@drmenzelit
Copy link
Contributor

What you say is correct @brianteeman but we are talking about the output of the pagebreak plugin that is incorrect

@brianteeman
Copy link
Contributor

my bad - the accordion in the component options doesnt use the library as I had expected. Luckily it uses its own custom-element

@brianteeman
Copy link
Contributor

according to the WAI best practices there should still be a role but this type =region to indicate a landmark region that contains the currently expanded accordion panel.

https://www.w3.org/WAI/ARIA/apg/patterns/accordion/examples/accordion/

@drmenzelit
Copy link
Contributor

I have tested this item ✅ successfully on a9a836d

Before PR: error in accessibility testing tools because of wrong "tab" role in the slider layout
After PR: no error


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40578.

@Bodge-IT
Copy link

I have tested this item ✅ successfully on a9a836d

Issue with 'Child roles required' from parent "tablist" role, no longer present.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40578.

@Hackwar
Copy link
Member

Hackwar commented Jan 19, 2025

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40578.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jan 19, 2025
@Hackwar Hackwar merged commit 8141452 into joomla:5.2-dev Jan 19, 2025
0 of 2 checks passed
@Hackwar Hackwar added this to the Joomla! 5.2.4 milestone Jan 19, 2025
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jan 19, 2025
@Hackwar
Copy link
Member

Hackwar commented Jan 19, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility bug PR-4.4-dev PR-5.2-dev Small A PR which only has a small change
Projects
None yet
Development

Successfully merging this pull request may close these issues.