-
Notifications
You must be signed in to change notification settings - Fork 6.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
Datepicker in bootstrap-modal #325
Comments
it would help to add some markdown to this post as its not readable... [your stuff here] |
I just couldn't understand the modal part. Let me see if got it right. place : function() {
if (this.isInline) return;
//get the first parent z-index, then add 10...
var zIndex = parseInt(this.element.parents().filter(function() {
return $(this).css('z-index') != 'auto';
}).first().css('z-index')) + 10;
//calc offset and height for element/component...
var offset = this.component ? this.component.offset() : this.element.offset();
var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(true);
var isInModal = this.element.parents('.modal').length;
var top = offset.top + height;
//if the element is in a modal subtract 40 from position. why this?
//with this part the calendar showed covering part of the element.
// I'm guessing is because your calendar is positioned above the element,
// In my case its' positioned below the element. So I removed it and worked like charm!
// Maybe some check is needed here.
if(isInModal) {
top = top - 40;
}
this.picker.css({
top : top,
left : offset.left,
zIndex : zIndex
});
} |
maybe its your version of the datepicker? I'm using the newest version in jschr's modal plugin and I'm not experiencing this problem either.. |
I've just updated both, the datepicker and the modal........still the same |
I had the same issue. My problem was in my personal css, I put a margin-top for |
I've just replicated this with the latest version of this plugin. |
Placing a datepicker as a component in a bootstrap modal would bind to the body rather than the element of the modal. This would cause the datepicker to scroll with the body while the modal remained in place. This patch binds the datepicker dropdown to the element where it was invoked and changes the computation of the offset to use position(), since offset() was relative to the window. Fixes uxsolutions#325.
Same issue with bs 3. Fixed by setting z-index to 1050. |
Have the same issue. And @timraymond fix doesn't help |
Can you guys confirm this is still an issue with the current master (should be fixed in 1.3.1), as #710 fixes issues with z-index |
@giaule56 did you upgrade to 1.3.1? |
Fixed in #1227 |
Hi,
I'm using the bootstrap-modal extension from here https://github.com/jschr/bootstrap-modal/
When I attach a datepicker to an input within a modal the picker is positioned far away under the input. I've extended your 'place'-method. Maybe you need it:
The text was updated successfully, but these errors were encountered: