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

[material-ui][Button] Hover animation glitches when component state changes #41352

Closed
ElsevarAsadov opened this issue Mar 3, 2024 · 2 comments
Assignees
Labels
component: button This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material status: waiting for author Issue with insufficient information

Comments

@ElsevarAsadov
Copy link

ElsevarAsadov commented Mar 3, 2024

Steps to reproduce

    const [timer, setTimer] = useState(0);

  useEffect(() => {
        const interval = setInterval(()=>{
            if(timer < examTime){
                setTimer(x=>x+1000);
            }
            else{
                setIsExamFinished(true);
                dispatch({type: 'open-dialog', data:{title: 'Xəbərdarlıq',  message:'İmtahan Bitdi.'}})
                clearInterval(interval)
            }
        }, 1000)
        return () => {
            clearInterval(interval)
        };
    }, [timer]);
    
    this is basic timer which my app uses to show time.

Current behavior

The weird thing is every time whenever i change time state button hover animation restarts again and this looks so weird.

2024-03-04.03-11-14.mp4

Expected behavior

No response

Context

No response

Your environment

No response

Search keywords: button

@ElsevarAsadov ElsevarAsadov added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 3, 2024
@zannager zannager added the component: button This is the name of the generic UI component, not the React module! label Mar 4, 2024
@danilo-leal danilo-leal changed the title Button hover animation glitches when component state change. [material-ui][Button] Hover animation glitches when component state changes Mar 5, 2024
@samuelsycamore
Copy link
Member

Hi @ElsevarAsadov ! 👋 Can you share a reproduction of your code (Codesandbox or GH repo) with the problem you're facing so we can take a look? Also, can you explain what you mean by the animation "glitching"? It's not clear to me what's happening in the screen recording you shared.

@danilo-leal danilo-leal added package: material-ui Specific to @mui/material and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 5, 2024
@samuelsycamore samuelsycamore added the status: waiting for author Issue with insufficient information label Mar 5, 2024
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

5 participants