Add inline documentation to role attribute removal

This commit is contained in:
Gabriel Manussakis 2024-08-28 14:43:45 -03:00
parent f88d090396
commit 253679737b
No known key found for this signature in database
GPG Key ID: 947CCD7D22B2FD1B
1 changed files with 3 additions and 0 deletions

View File

@ -568,6 +568,9 @@ jQuery( function( $ ) {
// Add new errors
if ( result.messages ) {
var $msgs = $( result.messages )
// The error notice template (plugins/woocommerce/templates/notices/error.php)
// adds the role="alert" to a list HTML element. This becomes a problem in this context
// because screen readers won't read the list content correctly if its role is not "list".
.removeAttr( 'role' )
.attr( 'tabindex', '-1' );
var $msgsWithLink = wc_checkout_form.wrapMessagesInsideLink( $msgs );