question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[b-alert] Dismissible alerts cannot be resused

See original GitHub issue

So I’m trying so use a single alert component in a parent vue component. Children pass up messages, and the parent resets the content and show value on the alert. I can’t get the alert to re-show because the show value in the parent isn’t updated when using the countdown. I try updating the show value with the dismiss countdown event, but that doesn’t work after I dismiss an alert.

https://jsfiddle.net/alexsasharegan/zrdur2cp/

  • Try dropping a msg into the input, letting it self-dismiss. All good.
  • Now try the other btn. Should be good.
  • Now fire a btn and dismiss. Should close.
  • Now fire another btn. DOA

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
TonBitscommented, Jul 21, 2017

Able to replicate this on the main documentation page using Chrome

https://bootstrap-vue.js.org/docs/components/alert/

Steps to replicate easily 1.) Click on the “Show alert with count-down timer” button 2.) Click the X mark quickly (less than a second after clicking the button above) 3.) Clicking the button again will not display the alert anymore.

This has something to do with the timing with the dismiss countdown timer.

0reactions
tmorehousecommented, Aug 20, 2017

PR’s #897 (0.x dev branch) and #898 (1.x branch) should address this.

The main root cause was actually the demo not listening to @dismissed and resetting the dismissCountDown value to 0.

What was happening is that dismissCountDown didn’t change when dimissed was called before the first second elapsed, So the dismissCountDown var still had a value that was the same as it was originally (the initial countdown value). So trying to set show to this value again never triggered the show watcher.

But these PRs also will emit a dismiss countdown event with value of 0 when dismissed is called as well, as a just in case.

I’ve re-enabled the dismiss button on auto-dismissing alerts.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Twitter Bootstrap alert message close and open again
Data-dismiss completely removes the element. Use jQuery's .hide() method instead. The fix-it-quick method: Using inline javascript to hide the element ...
Read more >
Alerts - Bootstrap
Using the alert JavaScript plugin, it's possible to dismiss any alert inline. Here's how: Be sure you've loaded the alert plugin, or the...
Read more >
Alerts · Bootstrap
Over a dozen reusable components built to provide buttons, dropdowns, input groups, navigation, ... For inline dismissal, use the alerts jQuery plugin.
Read more >
React Hooks + Bootstrap - Alert Notifications - Jason Watmore's
This tutorial shows how to implement a simple reusable alert component using React Hooks, Bootstrap CSS and RxJS.
Read more >
Bootstrap Alert Guide: Learn About Bootstrap Error Message
Using Bootstrap alerts, you can make predefined messages to appear in ... that can be closed, you need to use the .alert-dismissable class....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found