From 54153520f2e20fe81479e4c85ac1a529bafd8cc2 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Mon, 2 Oct 2017 19:24:24 +0000 Subject: [PATCH] Accessibility: Improve the Dashboard Nearby Events widget `wp.a11y.speak()` messages. Avoids to announce the "city updated" message on page load. Fixes #42037. git-svn-id: https://develop.svn.wordpress.org/trunk@41682 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/dashboard.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/js/dashboard.js b/src/wp-admin/js/dashboard.js index 71d0a18f1b..a6b56c37ef 100644 --- a/src/wp-admin/js/dashboard.js +++ b/src/wp-admin/js/dashboard.js @@ -425,7 +425,10 @@ jQuery( function( $ ) { template = wp.template( 'community-events-no-upcoming-events' ); $results.html( template( templateParams ) ); } - wp.a11y.speak( communityEventsData.l10n.city_updated.replace( l10nPlaceholder, templateParams.location.description ), 'assertive' ); + + if ( 'user' === initiatedBy ) { + wp.a11y.speak( communityEventsData.l10n.city_updated.replace( l10nPlaceholder, templateParams.location.description ), 'assertive' ); + } elementVisibility['#community-events-location-message'] = true; elementVisibility['.community-events-toggle-location'] = true;