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
Bootstrap show.bs.modal / Datepicker show.bs.modal conflict #978
Comments
Sorry, found the fix |
Reopened, issue not solved Here's an example: Just click on the button and then open datepicker |
I think I know why it's doing this, but I don't really know who should be responsible for fixing it. I've been experiencing a similar problem, except that I use the datepicker inline in a bootstrap modal. The end result is that when I first call The problem is that, according to the jQuery documentation of
At this point in the event handling, jQuery ignores the namespace I temporarily fixed it for myself by only initializing the datepicker when I'm about to show it. Thoughts? Should we take it to Bootstrap? |
This can be fixed by putting a namespace on datepicker's events #642 |
I would like to say that I too have come across this problem. Very annoying... |
Just found the issue as well. Is there a solution for this already ? Here is the modified fiddle showing the bug Tried the suggestions at the top, none of them seems to work when the datepicker is a inline one, as you can see in the fiddle. |
I had the same issue with an 'hide.bs.modal'-event for the modal. It was triggered when datepicker inside the modal was closed. |
Just faced with this issue in past a couple of hours. $("#my-modal").on("shown.bs.modal", function() { |
@mrlinnth thank you, this solved the issue for me!
|
Sometimes it's not practical to swap 'show' for 'shown' event. |
@SinnlosS Perfect, thank you. Applied the same to 'show' as well, highly annoying issue. |
+1 on this issue. A simple workaround is using For the sake of seeing how long this has been an issue, I'd like to see some investigation on the matter. |
Using modal.on('show.bs.modal', function(e) {
if (e.namespace === 'bs.modal') {
//
}
}); |
@bioteck Best solution. Thanks |
I agree @ebrost |
thanks @mrlinnth |
Fix the conflict with Bootstrap and Bootstrap-datepicker show.bs.modal event. Original issue: uxsolutions/bootstrap-datepicker#978
Thanks mister @bioteck |
Thanks @mrlinnth! |
@bioteck |
Has anyone got an example of how you do this?
doesn't appear to do anything? I get no console errors but the datepicker doesn't show up in my modal |
You are a lifesaver |
Omg I have the same issue and it is known for so long?? |
I also came across this problem, my solution was to put a validation to know if the event came from Datepicker or modal. dialog.on('show.bs.modal', function (e) {
if (e && (e.target == this || e.namespace == "bs.modal")) {
// Code here...
}
} |
This workaround didn't work well for me. So I did a check on the HTML node that trigger the event to execute my code when the modal hide or show. |
Hi,
I found some weird behaviour when using Datepicker inside a Bootstrap v3 Modal.
I have something like this
Everytime I click on a datepicker input my "reset my values" code gets executed
I found a solution here: http://stackoverflow.com/a/20059099/1909698
Which means my code works after adding:
Is it a bug or a feature? ;)
The text was updated successfully, but these errors were encountered: