question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

toastify autoClose not working

See original GitHub issue

bug

Tech Stack: Next js, React

What is the current behavior?

autoClose is not working until user clicks on toast

What is the expected behavior?

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

“react”:17.0.2" toast: tried with version 6 to 8

not sure but it was working with react: "^16.8.3"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
znalexandrcommented, Sep 8, 2021

I returned this code to my css and autoClose worked. I think autoClose depends on these styles:

@keyframes Toastify__trackProgress {
    0% {
      transform: scaleX(1);
    }
    100% {
      transform: scaleX(0);
    }
  }
  .Toastify__progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    z-index: var(--toastify-z-index);
    opacity: 0.7;
    transform-origin: left;
  }

  .Toastify__progress-bar--animated {
    animation: Toastify__trackProgress linear 1 forwards;
  }
0reactions
yashgandhi303commented, Sep 8, 2021

@znalexandr Thanks, that solved my problem. Closing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

autoClose doesn't work if you don't include ReactToastify.css
The autoClose is triggered when the progress bar animation end. An onAnimationEnd event is bound to the component. Regarding your needs, I see...
Read more >
Handling autoClose | React-Toastify - GitHub Pages
The autoClose prop accept a duration in milliseconds or false . #Change the default delay. Copy. import React from 'react';.
Read more >
React-toastify toasts don't close - Stack Overflow
I'm using the latest react-toastify i.e. version 7.0.4 btw, on downgrading to 6.2.0 I can see the close button work fine.
Read more >
NPM Package Versions - react-toastify - Socket.dev
Start using Socket to analyze react-toastify and its 1 dependencies to secure your ... fix AutoClose doesn't work on update #810 #782 #720...
Read more >
React Toastify Update Bug - CodeSandbox
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found