WordPress.org

Make WordPress Core

Ticket #36853: 36853.diff

File 36853.diff, 964 bytes (added by afercia, 2 years ago)
  • src/wp-includes/js/wp-a11y.js

     
    44        'use strict';
    55
    66        var $containerPolite,
    7                 $containerAssertive;
     7                $containerAssertive,
     8                previousMessage = '';
    89
    910        /**
    1011         * Update the ARIA live notification area text node.
     
    2324                // Ensure only text is sent to screen readers.
    2425                message = $( '<p>' ).html( message ).text();
    2526
     27                /*
     28                 * Safari 10+VoiceOver don't announce repeated, identical strings. We use
     29                 * a `no-break space` to force them to think identical strings are different.
     30                 * See ticket #36853.
     31                 */
     32                if ( previousMessage === message ) {
     33                        message = message + '\u00A0';
     34                }
     35
     36                previousMessage = message;
     37
    2638                if ( $containerAssertive && 'assertive' === ariaLive ) {
    2739                        $containerAssertive.text( message );
    2840                } else if ( $containerPolite ) {