sir-dunxalot / ember-tooltips

Easy and extendible tooltips for Ember components - http://sir-dunxalot.github.io/ember-tooltips/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

updateFor no longer works when switching to 3.x

kennydp opened this issue · comments

I am currently updating to 3.3.0 and I have a certain tooltip that uses updateFor to rerender. The updateFor no longer has any effect after updating, and it causes the tooltip to be positioned incorrectly after the state changes. I was wondering if it's still possible to do something like the updateFor with 3.x?

updateFor is still implemented in 3.x. Could you share some more details on how you're using it? Which version are you updating from?

I'm updating from 2.11.1 to 3.3.0.

So, in this particular case, when a tooltip shows we send a request for additional data, so in the tooltips you'll see our loading animation. Once the data is in, we show the actual data. The issue we get is that when the loading state is active, the tooltip is not as high as when the data is there. On the old version the tooltip would be pushed up, while now the tooltip gets put over your cursor.

@kennydp is there some code you can share for a reproducible test case?

Yeah sure, I'll try to put it in a twiddle. May only be tomorrow though, not sure if I have time to look into it today.

https://ember-twiddle.com/95db34917f2ae1d789361ad337fcd5d3?openFiles=controllers.application.js%2C

Here you can see the issue I'm having. Because the height changes, the tooltip gets pushed over the cursor, while before it would just be placed higher up.

@kennydp ahhh yeah. Thanks for the reproduction! I'll take a look this week!

@kennydp ahhh, found the trick for this: because isLoading is false, it's not hitting the code path for updateFor. The fix for this is that we should just be checking that it's not the default value of null. A workaround for the time being would be to return some sort of truthy value, but I'll probably tag a fix tonight