-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
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-timing is very inconsistent. #33906
Comments
I think we need to clear the timeout in the |
Probably something like this. The way i now got around this issue was by making the Toast a global variable in JS and then always doing |
@RyanBerliner any opinion on this, as you recently had a look on |
I don't believe clearing the timeout in the hide method would fix this issue (though it certainly wouldn't hurt), because the timeout is already being cleared in the show method. This looks to be the same bug that was fixed with #31155 - so I'd first recommend checking if version v5.0.0-alpha2 or later is being used. |
I used the version recommended in the bootstrap-dokumentation. No idea whether that's tha alpha or not though. |
I agree, this shouldn't happen. In the video the OP dismissed the toast so I considered the problem is with button.addEventListener('click', () => {
const toast = new bootstrap.Toast(toastEl);
toast.show();
}); Hard to tell because we don't know what the code looked like, but
suggests the OP used a code similiar to my example. In that case the timeout may not be cleared and could overlap, thus result in a behaviour like in that video. |
@alpadev Yep, that's pretty much what I did. |
if you still need a fix, I've posted here #37577 (comment) |
Before opening:
Toast-timing is very inconsistent.
Sometimes it's the regular delay (for example 10 seconds), but sometimes the toast just disappears way quicker.
BootstrapToasts.mp4
The text was updated successfully, but these errors were encountered: