We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import { Toaster, Position } from "@blueprintjs/core"; const toastr = Toaster.create({ position: Position.TOP }); let timesShown = 1; const key = toastr.show({ message: `shown ${timesShown}`, timeout: 100000 }); const interval = setInterval(() => { timesShown++; toastr.show( { message: `shown ${timesShown}`, timeout: timesShown === 10 ? 3000 : 100000 }, key ); if (timesShown === 10) { clearInterval(interval); } }, 1000);
The toastr keeps the original timeout of 100 seconds meaning that after finishing it still won't dismiss automatically
That updating the timeout will make the toastr dismiss when the new timeout triggers
in the toastr code
public componentDidUpdate(prevProps: IToastProps) { if (prevProps.timeout <= 0 && this.props.timeout > 0) { this.startTimeout(); } else if (prevProps.timeout > 0 && this.props.timeout <= 0) { this.clearTimeouts(); } }
that first check for prevProps.timeout <= 0 seems wrong. It should start the timeout regardless so that the newly passed timeout prop will be used.
prevProps.timeout <= 0
The text was updated successfully, but these errors were encountered:
@tgreen7 yep seems a legit bug!
Sorry, something went wrong.
No branches or pull requests
Environment
Steps to reproduce
Actual behavior
The toastr keeps the original timeout of 100 seconds meaning that after finishing it still won't dismiss automatically
Expected behavior
That updating the timeout will make the toastr dismiss when the new timeout triggers
Possible solution
in the toastr code
that first check for
prevProps.timeout <= 0
seems wrong. It should start the timeout regardless so that the newly passed timeout prop will be used.The text was updated successfully, but these errors were encountered: