fkhadra / react-toastify

React notification made easy 🚀 !
https://fkhadra.github.io/react-toastify/introduction
MIT License
12.33k stars 676 forks source link

Bug - Incorrect Decreasing Limit Behavior for Toasts #996

Closed mahmoudAcm closed 7 months ago

mahmoudAcm commented 10 months ago

Description: When setting the limit prop for toasts initially, the behavior of the limit is not working as expected. After displaying the initial set of toasts, the limit appears to decrease by one each time a toast disappears, which results in an unexpected and incorrect display of toasts.

Steps to Reproduce:

  1. Configure the toast component with an initial limit prop, e.g., limit={4}.
  2. Trigger multiple toasts to be displayed so that the limit is reached and 4 toasts are shown.
  3. Observe the displayed toasts and the remaining limit.
  4. Wait for the toasts to disappear one by one.

Expected Behavior:

Actual Behavior:

This bug affects the intended behavior of the limit prop for the toast component and should be addressed to ensure a consistent and accurate display of toasts based on the specified limit.

fkhadra commented 8 months ago

I think this issue is addressed in the v10. Mind giving a try ?

npm i react-toastify@beta
mahmoudAcm commented 7 months ago

I tried it, and it works perfectly fine! This issue has been resolved. Thank you @fkhadra for the fix.

fkhadra commented 7 months ago

Awesome thanks for testing I'm finishing the doc and I'll publish the v10 this week