fkhadra / fkhadra/react-toastify

`autoClose` is not respected when manually setting `progress` to 1

Open
#1,116 3 comments 5 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
13.4k
Forks
741
PR merge metrics
No merged PRs in 30d

Description

**Do you want to request a *feature* or report a *bug*?**
Report a bug

**What is the current behavior?**
When manually setting `progress` to 1 via `toast.update(toastId, { progress: 1 })`, the toast auto closes even when `autoClose: false` is set.

**Steps to Reproduce + Repro:**
1. Create a toast that should not auto close using `const toastId = toast('your message', { autoClose: false })`
2. update the toast's progress manually using `toast.update(toastId, { progress: 1 })`
3. See the toast autoclose :(

CodeSandbox: https://codesandbox.io/p/sandbox/react-toastify-autoclose-with-progress-n5d5jg

**What is the expected behavior?**
If I use `autoClose: false`, then the toast should not close automatically

**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**
React 18, chromium based browser on Mac. I'm uncertain how this behaves on old versions of React

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.