-
Notifications
You must be signed in to change notification settings - Fork 11
Description
🐛 Bug Report: solid-motionone and solid-styled-components
I've encountered a couple of issues when using solid-motionone alongside solid-styled-components. Here are the problems and a demo to demonstrate them:
The class-based 'animate' function doesn't work as expected. When animating an element's position (e.g., x: 20) on mount, hovering over that element causes it to revert to its initial position (x: 0) before the hover animation can take effect. This seems to be a problem with solid-motionone not recognizing the initial animation.
Hover delay doesn't override the delay set in the transition. If a transition delay is set to 0.5 seconds and the hover delay is set to 0, the hover still has a delay of 0.5 seconds.
Demo:
https://stackblitz.com/edit/solidjs-templates-ywdyd1?ctl=1&embed=1&file=src/App.tsx (https://stackblitz.com/edit/solidjs-templates-ywdyd1?ctl=1&embed=1&file=src/App.tsx)
Please try hovering in the demo to see the issues in action.
Additionally, it would be helpful if we could use the stagger property inside the transition property on an element, rather than having to use the animate function and referring to the element by its class name.
Current workaround for using solid-motionone with a solid-styled-components:
const Btn = styled(Motion.button)// Your styles here;
It would be beneficial to update the documentation to include information on using solid-motionone with solid-styled-components.
As a member of the SolidJS community, I believe that addressing this bug is crucial for maintaining the high quality and usability of the solid-motionone library. I understand that you are a busy individual, but I hope that you can find the time to investigate this issue and work on a fix. The community and I would be extremely grateful for your help in resolving this problem.
If you need any further information or clarification, please don't hesitate to ask. Thank you for your help in resolving these issues!