Skip to content

Commit

Permalink
Tooltip icon to be tabbed and showing the tooltip (#3431)
Browse files Browse the repository at this point in the history
* Tooltip tab-able.

* adding role as button to tooltip icon

* Tooltip: adding eventListner for enter to focus

* remove the event listener
  • Loading branch information
seanchoi-dev authored Jan 23, 2025
1 parent 4d69057 commit 2fe3f8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libs/features/icons/icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@
border-color: transparent transparent #0469E3;
}

.milo-tooltip:hover::before {
.milo-tooltip:hover::before,
.milo-tooltip:focus::before,
.milo-tooltip:active::before {
display: block;
}

.milo-tooltip:hover::after {
.milo-tooltip:hover::after,
.milo-tooltip:focus::after,
.milo-tooltip:active::after {
display: block;
}
2 changes: 2 additions & 0 deletions libs/features/icons/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ function decorateToolTip(icon) {
// Position is the next to last part of a tooltip
const place = conf.pop()?.trim().toLowerCase() || 'right';
icon.className = `icon icon-info milo-tooltip ${place}`;
icon.setAttribute('tabindex', '0');
icon.setAttribute('role', 'button');
wrapper.parentElement.replaceChild(icon, wrapper);
}

Expand Down

0 comments on commit 2fe3f8b

Please sign in to comment.