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

onClose props has 1s delay #685

Closed
DjovDev opened this issue Dec 30, 2021 · 4 comments
Closed

onClose props has 1s delay #685

DjovDev opened this issue Dec 30, 2021 · 4 comments

Comments

@DjovDev
Copy link

DjovDev commented Dec 30, 2021

        toast(<Msg/>, { 
          onClose : () => console.log('closing'), //this has aprox 1s delay
          onOpen : () => console.log('opening') //this is instant
        })
@DjovDev
Copy link
Author

DjovDev commented Dec 30, 2021

Possible duplicate of #487 ?

@fkhadra
Copy link
Owner

fkhadra commented Jan 22, 2022

Hey @DjovDev, onClose is called after the exit transition is completed. Even though the notification is not visible on the screen when removed, the exit animation is not completed, hence the delay.

@fkhadra fkhadra closed this as completed Jan 29, 2022
@claytonrothschild
Copy link

I also ran into this problem, where the delay causes the user to lose his "instruction" but he can still take his "action" within one second. This causes UX problems.

I dont want to convolute the library (which is great), but I do propose exploring these additional callbacks:

  • onDismiss or onAutoClose - when the toast is dismissed automatically rather than thru user interaction
  • onCloseStart and onCloseEnd - self-explanatory

@jihea-park
Copy link

@fkhadra
Same opinion as @claytonrothschild .
what about add onCloseStart handler?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants