Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
fix(tooltip): changing direction causes invalid position (#11087)
Browse files Browse the repository at this point in the history
Providing the initial origin through the `panelClass` of the panel is not the right approach. `mdPanel` remembers the original panel configuration and the provided `panelClass` and will restore it when the element is reused. This results in the new origin and the default (bottom) origin style to be placed on the element.

Fixes #10405
  • Loading branch information
oliversalzburg authored and mmalerba committed Feb 6, 2018
1 parent 827990e commit 89bd69b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/tooltip/tooltip.js
Expand Up @@ -387,11 +387,14 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $interpolate,
attachTo: attachTo,
contentElement: element,
propagateContainerEvents: true,
panelClass: 'md-tooltip ' + origin,
panelClass: 'md-tooltip',
animation: panelAnimation,
position: panelPosition,
zIndex: scope.mdZIndex,
focusOnOpen: false
focusOnOpen: false,
onDomAdded: function() {
panelRef.panelEl.addClass(origin);
}
};

panelRef = $mdPanel.create(panelConfig);
Expand Down

0 comments on commit 89bd69b

Please sign in to comment.