joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[4.4] Remove alt-text for menuItem with image and title

Open chmst opened this issue 2 years ago • 13 comments

Pull Request for Issue # .

Summary of Changes

In the menu layouts menus can have an image followed by an text. Alt-text for images are generated equal to the menuitem title. If the menutype is a link, this is an a11y issue, in other cases it is useless.

This PR replaces the alt text by an empty alt-text for all menutypes.

Testing Instructions

Code inspect and sourcecode inspect. Or use a tool like IBM accessible audit in your browser and check your menus with images.

Actual result BEFORE applying this Pull Request

grafik

Expected result AFTER applying this Pull Request

grafik

Link to documentations

Please select:

  • [ ] Documentation link for docs.joomla.org:

  • x] No documentation changes for docs.joomla.org needed

  • [ ] Pull Request link for manual.joomla.org:

  • [x No documentation changes for manual.joomla.org needed

chmst avatar May 29 '23 09:05 chmst

LGTM

brianteeman avatar May 29 '23 10:05 brianteeman

When Display Menu Item Title is disabled, then won't it be an a11y issue without the alt text?

Quy avatar Jun 24 '23 18:06 Quy

No, as there is the menu item text , but hidden for sighted users <span class="visually-hidden">' . $item->title . '</span>'

chmst avatar Jun 24 '23 18:06 chmst

But this is not the case as seen below:

<li class="nav-item item-101"><a href="/joomla-cms-4.3-dev/index.php/home" ><img src="/joomla-cms-4.3-dev/images/joomla_black.png" alt="" width="225" height="50" loading="lazy"></a></li>

Quy avatar Jun 24 '23 18:06 Quy

Thank you for testing - will fix this asap

chmst avatar Jun 25 '23 11:06 chmst

I have tested this item :white_check_mark: successfully on b63b61155931691165a235a3f97edaa351670417

Using axe DevTools the menu image was flagged as Alternative text of images should not be repeated as text. With the patch that flag disappeared.


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

ceford avatar Sep 26 '23 13:09 ceford

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

HLeithner avatar Sep 30 '23 22:09 HLeithner

So any news here? Still open. Btw you may add "width" & "height" attributes to this <img> as well.

pl71 avatar Mar 30 '24 06:03 pl71

So any news here? Still open. Btw you may add "width" & "height" attributes to this <img> as well.

The attributes width and height are not required for an img element. The preserve the required space on a html page one can also use aspect-ratio

@chmst can you fix the error "This branch is out-of-date with the base branch" by merging most resent branch 4.4-dev into it?

hans2103 avatar Mar 30 '24 14:03 hans2103

The attributes width and height are not required for an img element. The preserve the required space on a html page one can also use aspect-ratio

@hans2103 Many things are not required, but I want a 100 score on PageSpeed Insights. :)

pl71 avatar Mar 30 '24 18:03 pl71

@pl71 consider creating a jlayout image to render the image using a cdn like imagekit and serve the image with the correct width and height

hans2103 avatar Mar 30 '24 20:03 hans2103

Probably some day. But for one icon only...

pl71 avatar Mar 31 '24 07:03 pl71

This one here is not RTC, it has only one test.

laoneo avatar Aug 29 '24 09:08 laoneo

Back to pending as it has only one test


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

laoneo avatar Aug 30 '24 05:08 laoneo

I have tested this item :white_check_mark: successfully on 87b1361184413f0ca7fdc90076f226ab15da7d69


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

hans2103 avatar Aug 30 '24 14:08 hans2103

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

HLeithner avatar Nov 15 '24 13:11 HLeithner

I have tested this item :white_check_mark: successfully on 731bba015deb0de3ed8f0b0e187b9a78fceed4ec

Works fine. It adds an empty ALT to the purely decorative menu item image


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

pe7er avatar Jan 18 '25 12:01 pe7er

RTC


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

pe7er avatar Jan 18 '25 12:01 pe7er