Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1485950

    Hi,

    We observed duplicate id-attributes in the mobile menu (hamburger-menu), similar to what is described in

    This came up when trying to check and optimize website-compatiblity for screenreaders. Nodes of the main menu are copied over to the hamburger-menu. svg-icons (for the search) contain id-attributes which simply get duplicated – but obviously need to be transformed to become unique again.

    A modification of this copy-behaviour would for example be possible in
    wp-content/themes/enfold/js/avia-snippet-hamburger-menu.js
    in function normalize_layout().

    Quick-and-dirty code for those replacements:
    There was:
    var menu2 = $(‘#header .main_menu’).clone(true),
    ul = menu2.find(‘ul.av-main-nav’),
    id = ul.attr(‘id’);

    We then added lines to search for the corresponding nodes in the HTML with jQuery and make replacements for all hits. ‘-hamburger’ is appended to the IDs.

    var toChange;
    toChange = menu2.find(‘[id^=av-svg-desc-‘);
    toChange.each(function() {
    $(this).attr(‘id’, $(this).attr(‘id’) + ‘-hamburger’);
    });
    toChange = menu2.find(‘[id^=av-svg-title-‘);
    toChange.each(function() {
    $(this).attr(‘id’, $(this).attr(‘id’) + ‘-hamburger’);
    });
    toChange = menu2.find(‘[aria-labelledby^=av-svg-title-‘);
    toChange.each(function() {
    $(this).attr(‘aria-labelledby’, $(this).attr(‘aria-labelledby’) + ‘-hamburger’);
    });
    toChange = menu2.find(‘[aria-describedby^=av-svg-desc-‘);
    toChange.each(function() {
    $(this).attr(‘aria-describedby’, $(this).attr(‘aria-describedby’) + ‘-hamburger’);
    });

    It’s quite an edge case, but could potentially irritate a screen reader.

    #1485967

    Hey jugalbandi3,

    The thread you linked to is 8 years old, if it was a problem then, it would have been fixed by now. Where can we see the actual problem on your site?

    Best regards,
    Rikard

    #1485976

    Hi Rikard,

    Thank you for your reply!

    We had the problem with the current Enfold version: 7.1, and came across the old post while looking for a solution.

    We then solved the problem in a development environment as described and posted the article here if anyone else has the same problem.
    Perhaps there will also be an adjustment in Enfold itself in the next update.

    Best regards,
    jugalbandi3

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.