Make WordPress Core

Changeset 58450


Ignore:
Timestamp:
06/20/2024 08:25:38 PM ( 8 days 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  
    one hundred and six one hundred and six                 $body = $( document.body );
    one hundred and seven one hundred and seven
      one hundred and eight             $( '#wpwrap' ).attr( 'aria-hidden', 'true' );
    one hundred and eight one hundred and nine             $body.addClass( 'modal-open' );
    one hundred and nine one hundred and ten             wpLink.modalOpen = true;
     
    two hundred and eighty-two two hundred and eighty-three         close: function( reset ) {
    two hundred and eighty-three two hundred and eighty-four             $( document.body ).removeClass( 'modal-open' );
      two hundred and eighty-five             $( '#wpwrap' ).removeAttr( 'aria-hidden' );
    two hundred and eighty-four two hundred and eighty-six             wpLink.modalOpen = false;
    two hundred and eighty-five two hundred and eighty-seven
  • trunk/src/wp-includes/class-wp-editor.php

    r57193 r58450  
    one thousand eight hundred and seventy-six one thousand eight hundred and seventy-six         ?>
    one thousand eight hundred and seventy-seven one thousand eight hundred and seventy-seven         <div id="wp-link-backdrop" style="display: none"></div>
    one thousand eight hundred and seventy-eight           <div id="wp-link-wrap" class="wp-core-ui" style="display: none" role="dialog" aria- labelledby="link-modal-title">
      one thousand eight hundred and seventy-eight         <div id="wp-link-wrap" class="wp-core-ui" style="display: none" role="dialog" aria- modal="true" aria- labelledby="link-modal-title">
    one thousand eight hundred and seventy-nine one thousand eight hundred and seventy-nine         <form id="wp-link" tabindex="-1">
    one thousand eight hundred and eighty one thousand eight hundred and eighty         <? php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?>
Note: See TracChangeset for help on using the changeset viewer.