material icon indicating copy to clipboard operation
material copied to clipboard

Datepicker is not scrolling automatically on Firefox

Open mjeanroy opened this issue 9 years ago • 8 comments

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=1010
  • Details:

Angular Versions: *

  • Angular Version: 1.5.6
  • Angular Material Version: 1.1.1

Additional Information:

  • Browser Type: * Firefox
  • Browser Version: * 50.0.2
  • OS: * 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.

mjeanroy avatar Dec 15 '16 13:12 mjeanroy

I forgot, here are the screenshots of the problem:

What happens :

screen shot 2016-12-15 at 14 40 08

What should happens:

screen shot 2016-12-15 at 14 40 19

mjeanroy avatar Dec 15 '16 14:12 mjeanroy

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.

topherfangio avatar Jan 04 '17 22:01 topherfangio

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.

mjeanroy avatar Jan 05 '17 08:01 mjeanroy

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.

topherfangio avatar Feb 03 '17 22:02 topherfangio

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)

image

but the one on the codepen does:

image

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.

henrymana avatar Mar 17 '17 23:03 henrymana

This may be a duplicate https://github.com/angular/material/issues/9952

henrymana avatar Mar 18 '17 18:03 henrymana

master seems to be fixed... https://material.angularjs.org/HEAD/demo/datepicker

perhaps this fixed the issue: https://github.com/angular/material/issues/10144

henrymana avatar Mar 18 '17 22:03 henrymana

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.

topherfangio avatar Mar 21 '17 18:03 topherfangio