@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
15
15
limitations under the License.
16
16
*/
17
17
18
- import React , { createRef , forwardRef , MouseEvent , ReactNode , RefObject } from "react" ;
18
+ import React , { createRef , forwardRef , MouseEvent , ReactNode , RefObject , useRef } from "react" ;
19
19
import classNames from "classnames" ;
20
20
import { EventType , MsgType , RelationType } from "matrix-js-sdk/src/@types/event" ;
21
21
import { EventStatus , MatrixEvent , MatrixEventEvent } from "matrix-js-sdk/src/models/event" ;
@@ -1513,7 +1513,12 @@ class E2ePadlock extends React.Component<IE2ePadlockProps, IE2ePadlockState> {
1513
1513
1514
1514
const classes = `mx_EventTile_e2eIcon mx_EventTile_e2eIcon_${ this . props . icon } ` ;
1515
1515
return (
1516
- < div className = { classes } onMouseEnter = { this . onHoverStart } onMouseLeave = { this . onHoverEnd } >
1516
+ < div
1517
+ className = { classes }
1518
+ onMouseEnter = { this . onHoverStart }
1519
+ onMouseLeave = { this . onHoverEnd }
1520
+ aria-label = { this . props . title }
1521
+ >
1517
1522
{ tooltip }
1518
1523
</ div >
1519
1524
) ;
@@ -1525,6 +1530,7 @@ interface ISentReceiptProps {
1525
1530
}
1526
1531
1527
1532
function SentReceipt ( { messageState } : ISentReceiptProps ) : JSX . Element {
1533
+ const tooltipId = useRef ( `mx_SentReceipt_${ Math . random ( ) } ` ) . current ;
1528
1534
const isSent = ! messageState || messageState === "sent" ;
1529
1535
const isFailed = messageState === "not_sent" ;
1530
1536
const receiptClasses = classNames ( {
@@ -1546,6 +1552,7 @@ function SentReceipt({ messageState }: ISentReceiptProps): JSX.Element {
1546
1552
label = _t ( "Failed to send" ) ;
1547
1553
}
1548
1554
const [ { showTooltip, hideTooltip } , tooltip ] = useTooltip ( {
1555
+ id : tooltipId ,
1549
1556
label : label ,
1550
1557
alignment : Alignment . TopRight ,
1551
1558
} ) ;
@@ -1559,6 +1566,7 @@ function SentReceipt({ messageState }: ISentReceiptProps): JSX.Element {
1559
1566
onMouseLeave = { hideTooltip }
1560
1567
onFocus = { showTooltip }
1561
1568
onBlur = { hideTooltip }
1569
+ aria-describedby = { tooltipId }
1562
1570
>
1563
1571
< span className = "mx_ReadReceiptGroup_container" >
1564
1572
< span className = { receiptClasses } > { nonCssBadge } </ span >
0 commit comments