Fix tooltips on Safari and Firefox

Previously, tooltips appeared out of place in Safari and Firefox
browsers.  It seemed that using custom properties for CSS values caused
this behavior (when those styles were removed, behavior was as usual).

Somehow, adding a Polymer.dom.flush() before calculating the tooltip
position seems to fix this problem.

Bug: Issue 7161
Change-Id: Ia439d6dac1d3a2067fedbfdf56f406df41525663
This commit is contained in:
Becky Siegel 2017-09-13 15:19:31 -07:00
parent 9797e3850b
commit 06bd6b8fed

View File

@ -105,6 +105,9 @@
},
_positionTooltip(tooltip) {
// This flush is needed for tooltips to be positioned correctly in Firefox
// and Safari.
Polymer.dom.flush();
const rect = this.getBoundingClientRect();
const boxRect = tooltip.getBoundingClientRect();
const parentRect = tooltip.parentElement.getBoundingClientRect();