Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Datepicker breaks after upgrading to angular 1.6.0-rc.1 or 1.6.0-rc.2 #10070

Closed
aresn opened this issue Nov 30, 2016 · 12 comments
Closed

Datepicker breaks after upgrading to angular 1.6.0-rc.1 or 1.6.0-rc.2 #10070

aresn opened this issue Nov 30, 2016 · 12 comments

Comments

@aresn
Copy link

aresn commented Nov 30, 2016

Actual Behavior:

  • What is the issue? *
    Angular 1.6.0-rc.1 and 1.6.0-rc.2 breaks datepicker. Datepicker opens up with an empty placeholder where the dates should be. After scrolling up for a while, dates starts appearing.

CodePen (or steps to reproduce the issue): *

Angular Versions: *

  • Angular Version: 1.6.0-rc.1 and 1.6.0-rc.2
  • Angular Material Version: 1.1.1

Additional Information:

  • Browser Type: * Firefox, Chrome
  • Browser Version: * Firefox: 50.0.1, Chrome: 54.0.2840.98
  • OS: * Mac OS X 10.12.1
@rudzikdawid
Copy link
Contributor

same issue on Linux

Browser Type: * Firefox, Chrome
Browser Version: * Firefox: 50.0, Chrome: 54.0.2840.100
OS: * Fedora 24

@BNigmatov
Copy link

same issue with Angular v.1.6.0 (stable) on Chrome 55.0.2883.75 m

@jr-cobweb
Copy link

jr-cobweb commented Dec 9, 2016

Having the same issue. I've started looking into it, but unfortunately my angular skills are somewhat limited. From what I can tell, the problem occurs in calendarMonthBody.js, on the code block included below

It looks like offset and oldOffset are always equal when using angular 1.6. Will continue looking into this, but thought I'd drop it here in case it is useful for anyone else.

scope.$watch(function() { return monthBodyCtrl.offset; }, function(offset, oldOffset) {
    if (offset !== oldOffset) {
        monthBodyCtrl.generateContent();
    }
});

Edit: If I'm correct in the above, then it looks like this is fixed in master, thanks to this commit.

@rupalchawla
Copy link

Angularjs has released 1.6.1-build.5199+sha.7f8bc58, did anyone test datepicker on this version?

@devversion
Copy link
Member

@rupalchawla We should have fixes those issues on master with SHA 342ee53, but we haven't released the changes yet.

Going to track this issue with #10111

@angularnewbee
Copy link

angularnewbee commented Dec 26, 2016

I can confirm issue persists in angularjs v1.6.1 with angular-material v1.1.1

edit: I use both stable releases.

@rudzikdawid
Copy link
Contributor

rudzikdawid commented Dec 26, 2016

http://angularjs.blogspot.com/2016/12/angular-material-beta-release-new-flex.html

For users on Angular Material 1.x, a new release is expected in early 2017 with bug fixes and security improvements.

Before it happens use this code:

angular.module('myApp', [])
  .config(function($compileProvider) {
    $compileProvider.preAssignBindingsEnabled(true);
  })

with $compileProvider.preAssignBindingsEnabled(true) datepicker works like charm

@rupalchawla
Copy link

thanks @rudzikdawid this works!

@angularnewbee
Copy link

@rudzikdawid that works on angular-material v1.1.1 stable with angularjs v1.6.1 stable

@eseliger
Copy link

This is just a workaround and not a fix though.

@GollaVenkatesh
Copy link

GollaVenkatesh commented Jan 19, 2018

angular.module('myApp', []).config(function($compileProvider) {
    $compileProvider.preAssignBindingsEnabled(true);
  }).config(['$qProvider', function ($qProvider) {
    $qProvider.errorOnUnhandledRejections(false);
  }]);

@Splaktar Splaktar added this to the 1.1.2 milestone Jan 27, 2018
@aman-kumayu
Copy link

Having the same issue. I've started looking into it, but unfortunately my angular skills are somewhat limited. From what I can tell, the problem occurs in calendarMonthBody.js, on the code block included below

It looks like offset and oldOffset are always equal when using angular 1.6. Will continue looking into this, but thought I'd drop it here in case it is useful for anyone else.

scope.$watch(function() { return monthBodyCtrl.offset; }, function(offset, oldOffset) {
    if (offset !== oldOffset) {
        monthBodyCtrl.generateContent();
    }
});

Edit: If I'm correct in the above, then it looks like this is fixed in master, thanks to this commit.

Thanks this works for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests