Material: md-datepicker opens on the wrong month when its container has a scroll bar

Created on 4 Jan 2017  路  7Comments  路  Source: angular/material

Actual Behavior:

  • What is the issue? *
    md-datepicker opens on the wrong month when its container has a scrollbar and the input is not located at the top of that container.
  • What is the expected behavior?
    md-datepicker should always open on the right date

CodePen (or steps to reproduce the issue): *

Angular Versions: *

  • Angular Version: 1.5.8
  • Angular Material Version: 1.1.1

Additional Information:

  • Browser Type: * Chrome
  • Browser Version: * 55
  • OS: * OS X 10.11.6
  • Stack Traces: none
duplicate

Most helpful comment

This same issue was referenced in #10144. @ppham27 submitted a PR to fix it. Using his build in your codepen fixes the issue for me. I'm really hoping it will land in the next release.

http://codepen.io/twolfe/pen/qRENEd

All 7 comments

I'm experiencing this same issue.

This same issue was referenced in #10144. @ppham27 submitted a PR to fix it. Using his build in your codepen fixes the issue for me. I'm really hoping it will land in the next release.

http://codepen.io/twolfe/pen/qRENEd

Awesome. Thanks, @wolfet !

not working on
angular 1.6.2
angular material 1.1.3

I'm seeing this problem with md-datepicker with or without parent having a scroll.

Angular: 1.6.0.
Angular Material: 1.1.1.

Datepicker.js module:

@alanssoares ... I found out the issue occurred inside the below method of CalendarMonthBodyCtrl.

CalendarMonthBodyCtrl.prototype.generateContent = function() {
..
}

Commenting the below line fixed the issue for me:

//this.focusAfterAppend.focus();

This worked for me too: #9952

Angular: 1.5.5 & 1.6.2
Angular Material: 1.1.3

Duplicate of https://github.com/angular/material/issues/10144. Fixed in 1.1.5. You can also see this working in HEAD based on the provided demo: http://codepen.io/arthur_souviron/pen/vgYVPy

Was this page helpful?
0 / 5 - 0 ratings