-
grantourismomedia
With PageSpeed Insights Accessibility report, I get this error:
ARIA IDs are not unique.It apparently is related to the search box on the main menu and perhaps the off-canvas mobile menu.
<input type=”text” tabindex=”-1″ role=”searchbox” id=”mega-search-84321″ aria-label=”Search…” data-placeholder=”Search…” name=”s”>
Search…
<input type=”text” tabindex=”-1″ role=”searchbox” id=”mega-search-84321″ aria-label=”Search…” data-placeholder=”Search…” name=”s”>Site in private info.
Thanks
-
Fernando
Hi there,
Give the Search Block in the Off Canvas a class of
cu-search-change-aria-label
Adding Custom Classes: https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/
Then, add this snippet:
add_filter( 'render_block', function( $block_content, $block ) { if ( !is_admin() && ! empty( $block['attrs']['className'] ) && strpos( $block['attrs']['className'], 'cu-search-change-aria-label' ) !== false ) { $myreplace = 'aria-label="Search"'; $myinsert = 'aria-label="Off Canvas Panel Search"'; $block_content = str_replace( $myreplace, $myinsert , $block_content ); } return $block_content; }, 10, 2 );
Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
-
grantourismomedia
Greetings,
Thanks for that. I don’t think the class is being recognized as I have added it to the menu through the Off Canvas Panel Widget. I guess I’ll have to add it as an Element > Block > inside_slideout_navigation?Thanks
-
Hi there,
those errors are related to the navigation search which is coming from a plugin.
You would need to check with the plugin author on how to fix that. Or use a different search (?) -
grantourismomedia
Hey David, it turns out to be MegaMenu,so I created a ticket with them.
Cheers
T -
You’re welcome
- You must be logged in to reply to this topic.