File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -300,15 +300,21 @@ export function computeAccessibleName(
300300 }
301301 }
302302
303- // Text children are already part of one inline phrase and contain their own spacing.
304- // Other elements contribute separate accessible names, so separate them with spaces.
303+ return joinAccessibleNameParts ( parts , { inline : isHostText ( instance ) } ) ;
304+ }
305+
306+ function joinAccessibleNameParts (
307+ parts : AccessibleNamePart [ ] ,
308+ options : { inline : boolean } ,
309+ ) : string {
305310 return parts . reduce ( ( accessibleName , part , index ) => {
306311 if ( index === 0 ) {
307312 return part . text ;
308313 }
309314
310315 const previousPart = parts [ index - 1 ] ;
311- const separator = isHostText ( instance ) && previousPart . isInlineText && part . isInlineText ? '' : ' ' ;
316+ const separator =
317+ options . inline && previousPart . isInlineText && part . isInlineText ? '' : ' ' ;
312318 return `${ accessibleName } ${ separator } ${ part . text } ` ;
313319 } , '' ) ;
314320}
You can’t perform that action at this time.
0 commit comments