FIX: backtracking re-render" assertion in future-date-input (#13075)

FIX: backtracking re-render" assertion in future-date-input (#13075)

Backtracking re-render refers to a scenario where, in the middle of the rendering process, you have modified something that has already been rendered.

See more details from the Ember team here [Glimmer 2] "Backtracking re-render" is now an assertion · Issue #13948 · emberjs/ember.js · GitHub.

We call _updateInput from init. _updateInput triggers onChangeInput which mutates a date that was given to future-date-input just a moment ago and a rendering cycle wasn’t finished yet.

diff --git a/app/assets/javascripts/discourse/app/components/future-date-input.js b/app/assets/javascripts/discourse/app/components/future-date-input.js
index 5dfed3a..b76c31d 100644
--- a/app/assets/javascripts/discourse/app/components/future-date-input.js
+++ b/app/assets/javascripts/discourse/app/components/future-date-input.js
@@ -24,7 +24,6 @@ export default Component.extend({
         date: datetime.format("YYYY-MM-DD"),
         time: datetime.format("HH:mm"),
       });
-      this._updateInput();
     }
   },
 

GitHub sha: 6d3c9755

This commit appears in #13075 which was approved by jjaffeux. It was merged by AndrewPrigorshnev.