File tree Expand file tree Collapse file tree
packages/react-core/src/components/JumpLinks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -244,6 +244,9 @@ export const JumpLinks: React.FunctionComponent<JumpLinksProps> = ({
244244 } ) ;
245245
246246 const id = getUniqueId ( ) ;
247+ const hasAriaLabelledBy = expandable || ( label && alwaysShowLabel ) ;
248+ const computedAriaLabel = hasAriaLabelledBy ? null : ariaLabel ;
249+ const computedAriaLabelledBy = hasAriaLabelledBy ? id : null ;
247250
248251 return (
249252 < nav
@@ -255,9 +258,9 @@ export const JumpLinks: React.FunctionComponent<JumpLinksProps> = ({
255258 isExpanded && styles . modifiers . expanded ,
256259 className
257260 ) }
258- aria-label = { expandable || ( label && alwaysShowLabel ) ? null : ariaLabel }
261+ aria-label = { computedAriaLabel }
259262 ref = { navRef }
260- aria-labelledby = { expandable || ( label && alwaysShowLabel ) ? id : null }
263+ aria-labelledby = { computedAriaLabelledBy }
261264 { ...props }
262265 >
263266 < div className = { styles . jumpLinksMain } >
@@ -287,8 +290,8 @@ export const JumpLinks: React.FunctionComponent<JumpLinksProps> = ({
287290 ) }
288291 </ div >
289292 < ul
290- aria-label = { expandable || ( label && alwaysShowLabel ) ? null : ariaLabel }
291- aria-labelledby = { expandable || ( label && alwaysShowLabel ) ? id : null }
293+ aria-label = { computedAriaLabel }
294+ aria-labelledby = { computedAriaLabelledBy }
292295 className = { styles . jumpLinksList }
293296 role = "list"
294297 >
You can’t perform that action at this time.
0 commit comments