Datepicker is not scrolling automatically on Firefox
Actual Behavior:
What is the issue? *
The current datepicker does not scroll automatically to the correct month when a date is selected and a max date is set (the problem does not appear with Chrome) and if the datepicker is inside a dialog (everything seems ok outside dialog).
What is the expected behavior?
The datepicker should scroll correctly to the appropriate month.
CodePen (or steps to reproduce the issue): *
CodePen Demo which shows your issue:http://codepen.io/anon/pen/woQmZO?editors=1010Details:
Angular Versions: *
Angular Version:1.5.6Angular Material Version:1.1.1
Additional Information:
Browser Type: *FirefoxBrowser Version: *50.0.2OS: *MacOS (reproduced on Windows and Linux Debian)Stack Traces:None.
I tried to debug a lot, and it seems that the problem comes from this floor approximation on the virtual-repeat container (i.e If I remove `Math.floor , everything is perfect).
Why is a floor operation needed? Do you think I can have a workaround until this bug is fixed and available in a new version?
Thank you very much for your help.
I forgot, here are the screenshots of the problem:
What happens :
What should happens:
I can't seem to reproduce this in Firefox 49.0.2 or after upgrading to 50.1.0.
Is this still happening for you after you upgrade? I'm wondering if it was just a glitch in that version of Firefox.
Hi @topherfangio,
Thanks for your answer. I confirm I still reproduce it with 50.1.0. My OS is OSX 10.11.6 (El Captain) but I saw the same problem on Linux and Windows 10. I did not test with Firefox 49, so I can't tell you if it worked with this version.
Did you test with the codepen I wrote?
Note that the problem does not appear if:
- The datepicker is not in a modal,
- The selected date is not "before" the current week.
Hi @mjeanroy,
I did indeed test your Codepen on both my mac and my Windows 10 machine (and just tested again) and still cannot reproduce.
That said, we just released version 1.1.3 which had some fixes for the Datepicker. You might try upgrading to see if that fixes your problem.
I see the same behavior with 1.1.3 in my development environment. But unfortunately I haven't identified the reason yet. In my case, I also use the datepicker within a dialog as well.
I did notice that when using chrome 56.0.2924.87 (64-bit) one of the embedded demos behaves different from the corresponding codepen demo.
https://material.angularjs.org/latest/demo/datepicker
Notice it does not scroll to today's date (march 17th)

but the one on the codepen does:

Regarding @mjeanroy code pen... it actually works in chrome for me. @mjeanroy is this still an issue for you? I am able to replicate but not with your codepen (strange bug).
Is there a way to programmatically scroll the datepicker to a specific date? Thank you.
This may be a duplicate https://github.com/angular/material/issues/9952
master seems to be fixed... https://material.angularjs.org/HEAD/demo/datepicker
perhaps this fixed the issue: https://github.com/angular/material/issues/10144
Indeed; I'm going to mark this as a duplicate of #9952. We might reopen that one as a few people are still having trouble, but it might be an isolated case. Waiting to hear more.