How can I avoid slow layout calculation on IE 11 w

2019-06-20 09:24发布

问题:

I am having a listener for displaying tooltips on hover which calculates the position of it using the jquery $.offset function.

On IE 11 I am getting horrible performance everytime that the listener is triggered causing a delay on showing the tooltip or even the hover css class of the element.

The part where the target elements are is embed on an angular app, if I load it directly the performance is just fine like in other browsers and I can see the call to getBoundingClientRect takes small time but if I interact with other views on angular before going to this one then the performance goes bad as it is shown in the screenshot.

(I know I shouldn't use jquery inside angular but I am pretty sure the problem is not because of that since it is working the first time I load the page and in other browsers too)

How could I avoid this layout recalculation or how I could find out what is causing this issue ?