Ensure tooltip contents is linked via aria to the target element (#10729)
* Ensure tooltip contents is linked via aria to the target element * Iterate * Fix tests * Fix tests * Update snapshot * Fix missing aria labels for more tooltips * Iterate * Update snapshots
This commit is contained in:
parent
8e962f6897
commit
99ac9e5029
22 changed files with 133 additions and 43 deletions
|
@ -92,7 +92,7 @@ export default class ReactionsRowButton extends React.PureComponent<IProps, ISta
|
|||
mx_ReactionsRowButton_selected: !!myReactionEvent,
|
||||
});
|
||||
|
||||
let tooltip;
|
||||
let tooltip: JSX.Element | undefined;
|
||||
if (this.state.tooltipRendered) {
|
||||
tooltip = (
|
||||
<ReactionsRowButtonTooltip
|
||||
|
|
|
@ -40,7 +40,7 @@ export default class ReactionsRowButtonTooltip extends React.PureComponent<IProp
|
|||
const { content, reactionEvents, mxEvent, visible } = this.props;
|
||||
|
||||
const room = this.context.getRoom(mxEvent.getRoomId());
|
||||
let tooltipLabel;
|
||||
let tooltipLabel: JSX.Element | undefined;
|
||||
if (room) {
|
||||
const senders: string[] = [];
|
||||
for (const reactionEvent of reactionEvents) {
|
||||
|
@ -72,7 +72,7 @@ export default class ReactionsRowButtonTooltip extends React.PureComponent<IProp
|
|||
);
|
||||
}
|
||||
|
||||
let tooltip;
|
||||
let tooltip: JSX.Element | undefined;
|
||||
if (tooltipLabel) {
|
||||
tooltip = <Tooltip visible={visible} label={tooltipLabel} />;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue