Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] whileInView transition values override the other transition values #2636

Open
OSAMA263 opened this issue Apr 22, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@OSAMA263
Copy link

OSAMA263 commented Apr 22, 2024

im trying to animate whileHover on a div opacity :[0,1]

what i want:

if i hover on the div the opacity goes from 0 to 1 it works if i hoverd and stayed on the div but..

what happens:

if i ran the mouse on the div fast the delay:3 works but i dont want the whileInView delay value to work if i hoverd on the div

import { motion} from "framer-motion";

export const App= () => {
  return (
    <>
      <motion.div
        style={{ background: "black", marginTop: 10 }}
        initial={{ opacity: 0 }}
        whileInView={{ opacity: 1, transition: { duration: 0.4, delay: 3 } }}
        whileHover={{
          opacity: [0, 1],
          transition: { duration: 0.3, delay: 0 },
        }}
      >
        text
      </motion.div>
    </>
  );
};

https://codesandbox.io/p/devbox/crazy-euler-4flt8c

@OSAMA263 OSAMA263 added the bug Something isn't working label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant