Skip to content

Commit

Permalink
Remove spoken announcement of category count from hook as currently t…
Browse files Browse the repository at this point in the history
…o much potential for rerender
  • Loading branch information
glendaviesnz committed Sep 12, 2023
1 parent 389285f commit 5fd5edc
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useRef,
useEffect,
} from '@wordpress/element';
import { _x, __, _n, isRTL, sprintf } from '@wordpress/i18n';
import { _x, __, isRTL } from '@wordpress/i18n';
import { useViewportMatch, usePrevious } from '@wordpress/compose';
import {
__experimentalItemGroup as ItemGroup,
Expand All @@ -19,7 +19,6 @@ import {
} from '@wordpress/components';
import { Icon, chevronRight, chevronLeft } from '@wordpress/icons';
import { focus } from '@wordpress/dom';
import { speak } from '@wordpress/a11y';
import { useSelect } from '@wordpress/data';

/**
Expand Down Expand Up @@ -136,17 +135,6 @@ export function usePatternsCategories(
label: _x( 'Uncategorized' ),
} );
}
speak(
sprintf(
/* translators: %d: number of categories . */
_n(
'%d category button displayed.',
'%d category buttons displayed.',
categories.length
),
categories.length
)
);
return categories;
}, [ allCategories, filteredPatterns, hasRegisteredCategory ] );

Expand Down

0 comments on commit 5fd5edc

Please sign in to comment.