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
|
@ -35,6 +35,10 @@ export default class TextWithTooltip extends React.Component<IProps> {
|
|||
public render(): React.ReactNode {
|
||||
const { class: className, children, tooltip, tooltipClass, tooltipProps, ...props } = this.props;
|
||||
|
||||
if (typeof tooltip === "string") {
|
||||
props["aria-label"] = tooltip;
|
||||
}
|
||||
|
||||
return (
|
||||
<TooltipTarget
|
||||
onClick={this.props.onClick}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue