Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 7563b47

Browse files
bradrichmmalerba
authored andcommitted
fix(mdTooltip): Tooltip role (#10052)
The tooltip role was being assigned to an element that is being detached and not re-attached, causing an a11y issue. The tooltip role is now being assigned to the panel element through the `role` attribute. Fixes #10045
1 parent 471b850 commit 7563b47

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/tooltip/tooltip.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $interpolate,
8989

9090
// Remove the element from its current DOM position.
9191
element.detach();
92-
element.attr('role', 'tooltip');
9392

9493
updatePosition();
9594
bindEvents();
@@ -385,7 +384,9 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $interpolate,
385384
panelRef = $mdPanel.create(panelConfig);
386385
}
387386

388-
panelRef.open();
387+
panelRef.open().then(function() {
388+
panelRef.panelEl.attr('role', 'tooltip');
389+
});
389390
}
390391

391392
function hideTooltip() {

0 commit comments

Comments
 (0)