Closed xsjcTony closed 1 year ago
v6 in my case:
Uncaught TypeError: _tooltipRef$current.forcePopupAlign is not a function
targetOffset
is removed in latest @rc-component/trigger
. For ref error, let me check.
targetOffset
is removed in latest@rc-component/trigger
. For ref error, let me check.
Thanks for that. If targetOffset
is not valid anymore, should we remove the TypeScript declaration for such prop? And also is there any way to achieve the same effect as targetOffset
previously did?
Yes. It should be clean up
嗯嗯好的。那请问下现在该怎么去改变他的定位呢?有没有什么prop可以透传给trigger? 文档好像很久没更新了, TS定义也靠不住了🫠😭
current is forceAlign
, ~let me compatible for forcePopupAlign
~
Seems it's better to declear Tooltip ref this time instead. Since origin is any
type.
@zombieJ Hey, thanks for the fix, but the issue still exists. Or if you want me to open a separate ticket, I can do it.
I made a minimal reproduction: https://stackblitz.com/edit/vitejs-vite-8228fq?file=src/App.tsx
If you open the console, you will see this error, and I think it's the reason the tooltip is not working correctly (where you can try by hovering on the icon and unhover). The same approach is working correctly in v5.3.1
, but after I upgraded to v6
, it breaks, so it's preventing me from upgrading to v6
:(
And also I still can't figure out how to use forceAlign
to achieve the same effect targetOffset
previously does:(
Is there any documentation on it? thanks.
targetOffset
is removed which not can realize by forceAlign
. For the reproduce, let me check ref issue.
@zombieJ Thanks for the inspection. But what I mean is, I realize that targetOffset
has been removed, so do you mean there's no way to achieve what targetOffset
is doing before it's getting removed? Or do we have some alternative way to achieve the same effect? I can't find any documentation related to it :(
Since we do not use targetOffset
prop, I though this is useless. But for your feedback, I think it should be add back. But not promise the deadline, it will back in some feature minor version.
Oh, thanks a lot for that. That would be really helpful if it can be added back.
@zombieJ Hey, appreciated the fix but it seems still not working for me. Can you please inspect the following:
Regarding the ref issue, yes it has been fixed, but the React icon is still not getting popup properly (it works in v5
)
Regarding the targetOffset
, I can see it has been added back, but it's not taking effect.
I've prepared two reproductions with exactly the same code, except one is v6
and another is v5
for you to compare.
v6: https://stackblitz.com/edit/vitejs-vite-8228fq?file=src/App.tsx v5: https://stackblitz.com/edit/vitejs-vite-jelnh4?file=src/App.tsx
Appreciate it!
@zombieJ Hey sorry to bother, but can you please have a look at my reproduction above,, as I confirmed just now both targetOffset
and tooltip on icon are still broken.
Please refer to #444 since this ticket is no longer active, thanks.
align
: The below code is not positioning the tooltip correctly inv6
, wherev5
does:For tooltip that is not working, I got the following errors in console:
It should be mainly because of the first
ref
one