-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Alerts added with JS cannot be dismissed #60
Comments
My demo showcases that later added alerts work properly, but please download the latest version and test (the CDN is not up to latest version yet) to make sure we're talking the same thing. Also make sure you check the demo on the button scripting, there is an example with a properly handled later added alert that works perfect. |
@thednp It is also an issue in the latest version. |
OK then, please provide a test demo I can check. |
jsfiddle doesn't work because it always adds js to the As described in my demo/doc, you must always make sure to have all JS in your site's |
Apparently I've not been able to get the message across:
|
Of course not. The Alert component can handle later added alerts on the fly as long as you have the right JS at the right place. |
But then it's not working as intended! Please take the above file and try running it in a browser, first as is (i.e. no preexisting alert) and then with the commented out section enabled (i.e. with a preexisting alert), I hope you will understand what this issue is all about. |
It seems Alert does not work in that case, when no alert component found and initialized before your code, any other later added alerts won't work. But here's an easy fix, when you append the alert to your wrapper, also initialize it, here's the fixed example. I added |
Thank you for looking into this and providing a workaround. However, are there any plans to resolve this issue in bootstrap.native itself? |
What I gave you isn't a workaround, it's the right way to do. |
Alerts added to the document using DOM operations in JS cannot be dismissed. A testcase is attached below:
In addition, and quite strangely in fact, if you remove the commented out section in the above testcase, the alerts can be dismissed for the
user-messages
div (but not for any other div).The text was updated successfully, but these errors were encountered: