You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the didInsertElement hook, one of the properties is explicitly updated,
this.set('bsDateTimePicker',bsDateTimePickerFn);
Which makes the date selecting significantly slower then the native js plugin, and also the ember-cli reports a deprecation warning
DEPRECATION: A property of <perx-dashboard@view:-outlet::ember476> was modified inside the didInsertElement hook.
You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation.
[deprecation id: ember-views.dispatching-modify-property]
Please kindly refactor this part a bit, the performance could be much boosted.
Cheers.
The text was updated successfully, but these errors were encountered:
I've just experienced the same issue and I've solved it by wrapping the setting of my own date property into Ember.run.next. Not nice but seems to work:
This is still a problem now, but probably due to another problem.
didReceiveAttrs calls _updateDateTimePicker, which updates all the attributes, not only the ones that changed. This seems to trigger a big update on the base datepicker that makes the browser lag. Maybe _updateDateTimePicker should get the attributes that changed so it can check which ones have changed? And then for the date parameter maybe have an extra check to see if the current value in the control is already the same? Something like this?
let oldDate = dateTimePicker.date();
let newDate = this.getAttr('date');
let dateChanged = (!oldDate && newDate || !oldDate.isSame(newDate));
With something like this I got the control much more responsive, though not quite the same as the 'native js' version.
In the
didInsertElement
hook, one of the properties is explicitly updated,Which makes the date selecting significantly slower then the native js plugin, and also the ember-cli reports a deprecation warning
Please kindly refactor this part a bit, the performance could be much boosted.
Cheers.
The text was updated successfully, but these errors were encountered: