Open christiancho opened 5 years ago
Hi, thanks for making this issue. I double checked the handle enter/update/delete example and the basic functionality seems to be working fine (you can see the onAppear
and onExit
callbacks working in that example) so there's no obvious bug from that side.
Can you confirm that the flipKey
is getting updated at the correct time, and that the FLIP transitions themselves are actually happening, the callbacks just aren't working? If it would be possible to put an example into a Codesandbox, that would also be helpful.
The flipKey is definitely updating correctly, but I don't see any transitions being applied. I can try to put it up on a sandbox, but it's a business application we haven't released yet. The basic logic is this:
useEffect
and useState
handle async requests and setting of state.Flipped
flipId
.Edit: Also, passing debug
as a prop to Flipper
doesn't do anything. Should it be triggering the browser debugger?
Did a bit more digging: animateFlippedElements
is returning undefined
. The docs say it should be returning a promise.
Ah, it does seem like something is wrong then, I will take a look this weekend, thank you for flagging.
@aholachek Is there a chance that it's a problem with object reference? I recently changed some code to return a new array of newly constructed objects on every fetch. Anyway, thanks for looking into this!
Nevermind - your examples for handleEnterUpdateDelete
generate new arrays with each change. This is very curious...
@aholachek, In my case animation callbacks didn't fire, when inverseFlipId prop setted.
<Flipped
flipId={createId(item.name, 'button')}
inverseFlipId={item.name} // if i comment this, onComplete start working.
scale
transformOrigin='center'
onComplete={element => {
element.classList.add(styles.close)
console.log(element) // didn't fire
}}
>
<button className={styles.plus}>
<Icon name='plus' />
</button>
</Flipped>
Edit: Also, passing
debug
as a prop toFlipper
doesn't do anything. Should it be triggering the browser debugger?
No, the debug
prop just pauses the animation at the beginning: https://github.com/aholachek/react-flip-toolkit#advanced-props
@christiancho could you just confirm you're using the latest version? (7.0.6)
@aholachek Good to know about debug
.
Yes, I'm on 7.0.6
.
Hi @christiancho, thanks for confirming. I thought I might have some idea of what could be going wrong, but so far I've been unable to reproduce this issue locally. If you could make a minimal codesandbox example for me to look at, that would be extremely helpful.
Hey @christiancho , @aholachek : I'm getting this same problem. Either of you were able to find out what was happening? Thanks a lot!
Same issue here.. any updates?
Hey - thanks for a great library. I'm having an issue having the animation callbacks being called:
None of those console log statements are being made, but
handleEnterUpdateDelete
is being called:Just for full context:
Label
is a styled component that receives all props. I've also verified that theFlipContext.Consumer
does get the props correctly: