Skip to content

Commit

Permalink
Address review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebulanStanphill committed Aug 17, 2020
1 parent a136134 commit 84f2a24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/block-library/src/heading/heading-level-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ export default function HeadingLevelDropdown( {
selectedLevel,
onChange,
} ) {
const instanceId = useInstanceId( HeadingLevelDropdown );
const helpTextId = useInstanceId(
HeadingLevelDropdown,
'block-library-heading__heading-level-dropdown__help'
);

const getLevelValidity = useHeadingLevelValidator( clientId );

Expand Down Expand Up @@ -127,11 +130,11 @@ export default function HeadingLevelDropdown( {
},
};
} ) }
aria-describedby={ `block-library-heading__heading-level-dropdown__help-${ instanceId }` }
aria-describedby={ helpTextId }
/>
</Toolbar>
<p
id={ `block-library-heading__heading-level-dropdown__help-${ instanceId }` }
id={ helpTextId }
className="block-library-heading__heading-level-dropdown__help"
>
<ExternalLink href="https://www.w3.org/WAI/tutorials/page-structure/headings/">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function useHeadingLevelValidator( currentBlockClientId ) {
)[ 0 ];
const hasTitle = isTitleSupported && titleIsNotEmpty && titleNode;
const hasMultipleH1 = useMemo(
() => headings.filter( ( { level } ) => level === 1 ).length > 1,
() => headings.some( ( { level } ) => level === 1 ),
[ headings ]
);

Expand Down

0 comments on commit 84f2a24

Please sign in to comment.