Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix flickering datepicker feature test

Christophe Bliard4533a6d816fe
diff --git a/frontend/src/app/shared/components/datepicker/datepicker.modal.ts b/frontend/src/app/shared/components/datepicker/datepicker.modal.ts
index 6eb8b01fad2..03a753043c0 100644
--- a/frontend/src/app/shared/components/datepicker/datepicker.modal.ts
+++ b/frontend/src/app/shared/components/datepicker/datepicker.modal.ts
@@ -110,6 +110,8 @@ export class DatePickerModalComponent extends OpModalComponent implements AfterV
dateChangedManually$ = new Subject<void>();
+ private debounceDelay = 0; // will change after initial render
+
private changeset:ResourceChangeset;
private datePickerInstance:DatePicker;
@@ -158,9 +160,12 @@ export class DatePickerModalComponent extends OpModalComponent implements AfterV
// 2. So he/she starts entering the finish date 2022-07-1 .
// 3. This is already a valid date. Since it is before the start date,the start date would be changed automatically to the first without the debounce.
// 4. The debounce gives the user enough time to type the last number "9" before the changes are converted to the datepicker and the start date would be affected.
- debounceTime(800),
+ // debounce delay is 0 for initial display, and then set to 800
+ debounceTime(this.debounceDelay),
)
.subscribe(() => {
+ // set debounce delay to its real value
+ this.debounceDelay = 800;
// Always update the whole form to ensure that no values are lost/inconsistent
if (this.singleDate) {
this.updateDate('date', this.dates.date);