@@ -84,11 +84,11 @@ class Tooltip extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
8484 theme$ ="[[_theme]] "
8585 opened ="[[__computeOpened(manual, opened, _autoOpened, _isConnected)]] "
8686 position-target ="[[target]] "
87- position ="[[position ]] "
88- no-horizontal-overlap$ ="[[__computeNoHorizontalOverlap(position )]] "
89- no-vertical-overlap$ ="[[__computeNoVerticalOverlap(position )]] "
90- horizontal-align ="[[__computeHorizontalAlign(position )]] "
91- vertical-align ="[[__computeVerticalAlign(position )]] "
87+ position ="[[__effectivePosition ]] "
88+ no-horizontal-overlap$ ="[[__computeNoHorizontalOverlap(__effectivePosition )]] "
89+ no-vertical-overlap$ ="[[__computeNoVerticalOverlap(__effectivePosition )]] "
90+ horizontal-align ="[[__computeHorizontalAlign(__effectivePosition )]] "
91+ vertical-align ="[[__computeVerticalAlign(__effectivePosition )]] "
9292 on-mouseleave ="__onOverlayMouseLeave "
9393 modeless
9494 > </ vaadin-tooltip-overlay >
@@ -173,7 +173,6 @@ class Tooltip extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
173173 */
174174 position : {
175175 type : String ,
176- value : 'bottom' ,
177176 } ,
178177
179178 /**
@@ -228,6 +227,21 @@ class Tooltip extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
228227 observer : '__autoOpenedChanged' ,
229228 } ,
230229
230+ /**
231+ * Default value used when `position` property is not set.
232+ * @protected
233+ */
234+ _position : {
235+ type : String ,
236+ value : 'bottom' ,
237+ } ,
238+
239+ /** @private */
240+ __effectivePosition : {
241+ type : String ,
242+ computed : '__computePosition(position, _position)' ,
243+ } ,
244+
231245 /** @protected */
232246 _overlayElement : Object ,
233247
@@ -341,6 +355,11 @@ class Tooltip extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
341355 return connected && ( manual ? opened : autoOpened ) ;
342356 }
343357
358+ /** @private */
359+ __computePosition ( position , defaultPosition ) {
360+ return position || defaultPosition ;
361+ }
362+
344363 /** @private */
345364 __tooltipRenderer ( root ) {
346365 root . textContent = typeof this . generator === 'function' ? this . generator ( this . context ) : this . text ;
0 commit comments