@@ -449,12 +449,12 @@ const Composer = forwardRef<
449
449
} , [ settingsStore ] )
450
450
451
451
if ( chatId === null ) {
452
- return < div ref = { ref } > Error, chatid missing</ div >
452
+ return < section ref = { ref } > Error, chatid missing</ section >
453
453
}
454
454
455
455
if ( isContactRequest ) {
456
456
return (
457
- < div ref = { ref } className = 'composer contact-request' >
457
+ < section ref = { ref } className = 'composer contact-request' >
458
458
< button
459
459
className = 'contact-request-button delete'
460
460
onClick = { async ( ) => {
@@ -487,13 +487,31 @@ const Composer = forwardRef<
487
487
>
488
488
{ tx ( 'accept' ) }
489
489
</ button >
490
- </ div >
490
+ </ section >
491
491
)
492
492
} else if ( ! selectedChat . canSend ) {
493
493
return null
494
494
} else {
495
495
return (
496
- < div className = 'composer' ref = { ref } >
496
+ < section
497
+ className = 'composer'
498
+ ref = { ref }
499
+ role = 'region'
500
+ // Note that there are other `return`s in this component,
501
+ // but this `aria-label` doesn't seem to apply to them.
502
+ //
503
+ // TODO a11y: when `isEditingModeActive`, we have an "Edit message"
504
+ // text, which we can use as the label / header.
505
+ aria-label = {
506
+ ( messageEditing . isEditingModeActive
507
+ ? window . static_translate ( 'edit_message' )
508
+ : window . static_translate ( 'write_message_desktop' ) ) +
509
+ // Make it clear which chat we're in.
510
+ // TODO probably need a proper string, with interpolation.
511
+ ': ' +
512
+ selectedChat . name
513
+ }
514
+ >
497
515
< div className = 'upper-bar' >
498
516
{ ! messageEditing . isEditingModeActive ? (
499
517
< >
@@ -598,7 +616,6 @@ const Composer = forwardRef<
598
616
}
599
617
}
600
618
chatId = { chatId }
601
- chatName = { selectedChat . name }
602
619
updateDraftText = { updateDraftText }
603
620
onPaste = { handlePaste ?? undefined }
604
621
onChange = { setCurrentEditText }
@@ -612,7 +629,6 @@ const Composer = forwardRef<
612
629
messageEditing . doSendEditRequest ?? ( ( ) => { } )
613
630
}
614
631
chatId = { chatId }
615
- chatName = { selectedChat . name }
616
632
// We don't store the edits as "drafts" anywhere except
617
633
// inside the <ComposerMessageInput> component itself,
618
634
// so this can be a no-op.
@@ -694,7 +710,7 @@ const Composer = forwardRef<
694
710
hideStickerPicker = { messageEditing . isEditingModeActive }
695
711
/>
696
712
) }
697
- </ div >
713
+ </ section >
698
714
)
699
715
}
700
716
} )
0 commit comments