ember-pikaday icon indicating copy to clipboard operation
ember-pikaday copied to clipboard

Uncaught Error: infinite rendering invalidation detected, with ember-pikaday 2.2.2

Open mariowilde opened this issue 7 years ago • 4 comments

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.

mariowilde avatar Mar 29 '17 07:03 mariowilde

Welcoming another PR

duizendnegen avatar Mar 29 '17 09:03 duizendnegen

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.

corrspt avatar May 26 '17 16:05 corrspt

+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
   },

gabrielle-ong avatar Sep 18 '17 05:09 gabrielle-ong

Welcoming a PR :)

duizendnegen avatar Sep 19 '17 07:09 duizendnegen