Make WordPress Core

Changeset 58450


Ignore:
Timestamp:
06/20/2024 08:25:38 PM (4 months ago)
Author:
joedolson
Message:

Editor: A11y: Set ARIA attributes for Classic Editor link inserter.

Set aria-modal and aria-hidden attributes when the Classic Editor link inserter modal is active, so that content behind the modal will be properly treated as inert when interacting with the modal.

Props lyonmuller, jwgoedert, sabernhardt, alexstine, afercia, rajinsharwar, rcreators, audrasjb, hmbashar, joedolson.
Fixes #60799.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/lib/link.js

    r50547 r58450  
    106106                $body = $( document.body );
    107107
     108            $( '#wpwrap' ).attr( 'aria-hidden', 'true' );
    108109            $body.addClass( 'modal-open' );
    109110            wpLink.modalOpen = true;
     
    282283        close: function( reset ) {
    283284            $( document.body ).removeClass( 'modal-open' );
     285            $( '#wpwrap' ).removeAttr( 'aria-hidden' );
    284286            wpLink.modalOpen = false;
    285287
  • trunk/src/wp-includes/class-wp-editor.php

    r57193 r58450  
    18761876        ?>
    18771877        <div id="wp-link-backdrop" style="display: none"></div>
    1878         <div id="wp-link-wrap" class="wp-core-ui" style="display: none" role="dialog" aria-labelledby="link-modal-title">
     1878        <div id="wp-link-wrap" class="wp-core-ui" style="display: none" role="dialog" aria-modal="true" aria-labelledby="link-modal-title">
    18791879        <form id="wp-link" tabindex="-1">
    18801880        <?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?>
Note: See TracChangeset for help on using the changeset viewer.