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

Commit 89bd69b

Browse files
oliversalzburgmmalerba
authored andcommitted
fix(tooltip): changing direction causes invalid position (#11087)
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
1 parent 827990e commit 89bd69b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/tooltip/tooltip.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,14 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $interpolate,
387387
attachTo: attachTo,
388388
contentElement: element,
389389
propagateContainerEvents: true,
390-
panelClass: 'md-tooltip ' + origin,
390+
panelClass: 'md-tooltip',
391391
animation: panelAnimation,
392392
position: panelPosition,
393393
zIndex: scope.mdZIndex,
394-
focusOnOpen: false
394+
focusOnOpen: false,
395+
onDomAdded: function() {
396+
panelRef.panelEl.addClass(origin);
397+
}
395398
};
396399

397400
panelRef = $mdPanel.create(panelConfig);

0 commit comments

Comments
 (0)