-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Toast without timeout and reason for onClose (user or timeout) #1737
Conversation
Fix #1706 and the comment #1708 (comment) |
Any updates? |
any updates on this? |
@danieloprado onClose is called twice with reason user and timeout, when duration is specified. |
@@ -102,7 +104,7 @@ class ToastContainer extends Component { | |||
{this.state.buttonText && ( | |||
<Button | |||
style={this.state.buttonStyle} | |||
onPress={() => this.closeToast()} | |||
onPress={() => this.closeToast('user')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this line to cancel the this.closeTimeout
when the user taps it
@akhil-geekyants that issue was there prior |
@akhil-geekyants the whole Toast component needs rethinking really. there's a few issues surrounding this |
Fixed! thanks for the feedback |
If duration is equal to 0 disable the toast timeout to close.
Added the reason that toast was closed: "user" when user press the button or "timeout" where duration ends.