Skip to content

Commit

Permalink
fix(Tooltip): make screenreader description less verbose (#8641)
Browse files Browse the repository at this point in the history
* fix: tooltip screenreader description

* fix: add back removed triggerId

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
jnm2377 and kodiakhq[bot] authored May 11, 2021
1 parent f69f887 commit b5f40d8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/react/src/components/Tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,8 @@ class Tooltip extends Component {
<div
className={`${prefix}--tooltip__trigger`}
{...properties}
ref={refProp}>
ref={refProp}
aria-describedby={tooltipBodyId}>
<IconCustomElement {...iconProperties} />
</div>
</div>
Expand All @@ -519,7 +520,8 @@ class Tooltip extends Component {
id={triggerId}
className={triggerClasses}
ref={refProp}
{...properties}>
{...properties}
aria-describedby={tooltipBodyId}>
{triggerText}
</div>
)}
Expand All @@ -544,14 +546,9 @@ class Tooltip extends Component {
onMouseOut={this.handleMouse}
onFocus={this.handleMouse}
onBlur={this.handleMouse}
onContextMenu={this.handleMouse}
role="tooltip">
onContextMenu={this.handleMouse}>
<span className={`${prefix}--tooltip__caret`} />
<div
className={`${prefix}--tooltip__content`}
role="dialog"
aria-describedby={tooltipBodyId}
aria-labelledby={triggerId}>
<div className={`${prefix}--tooltip__content`} role="dialog">
{children}
</div>
</div>
Expand Down

0 comments on commit b5f40d8

Please sign in to comment.