• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 5ab28f429a427cb08d455a3e5a8c5d3acfefb5c0

16 Jan 2026 08:31AM UTC coverage: 53.29% (-0.03%) from 53.315%
5ab28f429a427cb08d455a3e5a8c5d3acfefb5c0

Pull #22872

github

web-flow
Merge ea546b395 into d394743dd
Pull Request #22872: Fix keyboard focus management for AI Optimize button and toast notifications

8785 of 16304 branches covered (53.88%)

Branch coverage included in aggregate %.

12 of 51 new or added lines in 10 files covered. (23.53%)

64 existing lines in 8 files now uncovered.

32864 of 61852 relevant lines covered (53.13%)

46618.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/js/src/components/contentAnalysis/AIButtonFocusWrapper.js
1
import PropTypes from "prop-types";
2
import useAIButtonFocusFallback from "../../hooks/use-ai-button-focus-fallback";
3

4
/**
5
 * Wrapper component that manages focus for AI Optimize buttons.
6
 *
7
 * This component uses the useAIButtonFocusFallback hook to handle focus management
8
 * when AI Optimize buttons are interacted with. When a button is removed from the DOM
9
 * (after applying suggestions), focus moves to a fallback element instead of jumping
10
 * to the beginning of the page.
11
 *
12
 * @param {Object} props The component props.
13
 * @param {React.ReactNode} props.children The child components to render.
14
 * @param {Array} props.results The assessment results for this section.
15
 * @param {string} props.fallbackElementId The ID of the element to focus when the AI button is removed.
16
 *
17
 * @returns {JSX.Element} The children wrapped with focus management functionality.
18
 */
NEW
19
const AIButtonFocusWrapper = ( { children, results, fallbackElementId } ) => {
×
NEW
20
        useAIButtonFocusFallback( {
×
21
                results,
22
                fallbackElementId,
23
        } );
24

NEW
25
        return children;
×
26
};
27

NEW
28
AIButtonFocusWrapper.propTypes = {
×
29
        children: PropTypes.node.isRequired,
30
        results: PropTypes.array,
31
        fallbackElementId: PropTypes.string.isRequired,
32
};
33

NEW
34
AIButtonFocusWrapper.defaultProps = {
×
35
        results: [],
36
};
37

38
export default AIButtonFocusWrapper;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc