After implementing a Button from MUIv5, I noticed that the full animation only triggers when I hold down the button instead of with a simple click.
Is there a way to fix this so that the animation fully plays with just a single click? Any help is appreciated.
Below is the code snippet:
import Button from "@mui/material/Button";
export default function App() {
const buttonJSS = {
":active": {
animation: "MoveUpDown 0.3s linear",
animationFillMode: "forwards"
},
"@keyframes MoveUpDown": {
"0%, 100%": {
transform: "translateY(0)"
},
"50%": {
transform: "translateY(20px)"
}
}
};
return (
<div className="App">
<Button sx={buttonJSS}>MY BUTTON</Button>
</div>
);
}
You can view the code on CodeSandbox: https://codesandbox.io/s/clever-frog-rim6xw?file=/src/App.js