asmyshlyaev177/react-horizontal-scrolling-menu

Ability to animate children

Deutrix opened this issue · 10 comments

I am trying to create animated effects on children but Formkit AutoAnimate or React Flip Move requires to have a ref on parent or parent wrapper which is not possible in this case.

Tried creating one wrapper with the children then two at the sides and it's working but not so good.

Do you have any suggestions?

Hm, that an interesting issue, let me think about that.

I can make it work with AutoAnimate, just need 1-2 days to update tests and check it.

Amazing, thank you very much. I will test it today.

Seems like shuffle animation doesn't work, maybe will figure it out, it requires a bigger change.

Tested, it is flashing during animation.

This is an example how it works with those three elements: https://deutrix.digital/JiLu4/YIbajAhu06.mp4

<div className="x-flex x-w-1 x-flex-row"></div>
<div
    className={cn(
        "x-flex x-flex-row",
        sizes[size],
    )} ref={animationRef}>
    {children}
</div>
<div className="x-flex x-w-1 x-flex-row"></div>

This is 6.1.0 version with ref on the ScrollMenu https://deutrix.digital/JiLu4/kizoYEME76.mp4

Tested, it is flashing during animation.

This is an example how it works with those three elements: https://deutrix.digital/JiLu4/YIbajAhu06.mp4

<div className="x-flex x-w-1 x-flex-row"></div>
<div
    className={cn(
        "x-flex x-flex-row",
        sizes[size],
    )} ref={animationRef}>
    {children}
</div>
<div className="x-flex x-w-1 x-flex-row"></div>

This is 6.1.0 version with ref on the ScrollMenu https://deutrix.digital/JiLu4/kizoYEME76.mp4

I see, created issue in auto-atomate, but probably will end up removing Separator elements from my lib.

@Deutrix Refactored it, working correctly now, check out a new version.

@asmyshlyaev177 Thank you. Works perfectly.