mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-02-26 08:03:56 -05:00
fix(a11y): associate block content panel with the header (#55366)
This commit is contained in:
@@ -250,6 +250,7 @@ class Block extends Component<BlockProps> {
|
||||
<h3 className='block-grid-title'>
|
||||
<button
|
||||
aria-expanded={isExpanded ? 'true' : 'false'}
|
||||
aria-controls={`${blockDashedName}-panel`}
|
||||
className='block-header'
|
||||
onClick={() => {
|
||||
this.handleBlockClick();
|
||||
@@ -281,14 +282,16 @@ class Block extends Component<BlockProps> {
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
{isExpanded && <BlockIntros intros={blockIntroArr} />}
|
||||
{isExpanded && (
|
||||
<Challenges
|
||||
challengesWithCompleted={challengesWithCompleted}
|
||||
isProjectBlock={isProjectBlock}
|
||||
isGridMap={true}
|
||||
blockTitle={blockTitle}
|
||||
/>
|
||||
<div id={`${blockDashedName}-panel`}>
|
||||
<BlockIntros intros={blockIntroArr} />
|
||||
<Challenges
|
||||
challengesWithCompleted={challengesWithCompleted}
|
||||
isProjectBlock={isProjectBlock}
|
||||
isGridMap={true}
|
||||
blockTitle={blockTitle}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</ScrollableAnchor>
|
||||
|
||||
Reference in New Issue
Block a user