ember-pikaday
ember-pikaday copied to clipboard
Uncaught Error: infinite rendering invalidation detected, with ember-pikaday 2.2.2
On ember 2.12 ember-pikaday 2.2.2 still causes the infinite rendering invalidation that first appeared in version 2.2.1. Downgrading to 2.2.0 resolves the issue. Seems like #140 did not fix the error.
Welcoming another PR
In case anyone get's here, I had a situation where I was using a "maxDate" to be equal to "today" in ember-pikaday and when the user selected that day it would blow up with this error. To work-around it I did the following:
template.hbs
{{pikaday-input value=value maxDate=currentDate}}
components.js
currentDate: computed(function() {
let today = moment(new Date()).endOf('day');
return today.toDate();
}),
By setting the currentDate to the end of the day (23:59:59) it seems that whatever is triggering the error does not happen.
+1 for this, downgrading to 2.2.0 resolves this error for me. This only occured for users whose timezone is behind UTC time, regardless if I set useUTC=true
. Details:
{{pikaday-input onSelection=(action 'changedDateValue')
value=order.shipAt
minDate=minDate
useUTC=true}}
//component.js
minDate: new Date(),
actions:
changedDateValue(date) {
// debugging log:
// new Date() => Sun Sep 17 2017 22:34:56 GMT-0700 (PDT)
// date => Sat Sep 16 2017 17:00:00 GMT-0700 (PDT)
// this.get('minDate') => Sun Sep 17 2017 00:00:00 GMT-0700 (PDT)
this.set('order.shipAt', date); //infinite loop occurs
},
Welcoming a PR :)