Skip to content

Commit dbaf37b

Browse files
committed
Attempt to fix test
1 parent 4f75eec commit dbaf37b

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

frontend/src/stimulus/controllers/dynamic/admin/backlogs-settings.controller.ts

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,33 +66,37 @@ export default class BacklogsSettings extends Controller<HTMLElement> {
6666
private onStoryTypesActivated = (_event:CustomEvent) => {
6767
if (this.isUpdating || !this.hasStoryTypesTarget) return;
6868

69-
const taskAutocomplete = this.autocompleterElementFor(this.taskTypeTarget);
70-
const storyAutocomplete = this.autocompleterElementFor(this.storyTypesTarget);
69+
setTimeout(()=> {
70+
const taskAutocomplete = this.autocompleterElementFor(this.taskTypeTarget);
71+
const storyAutocomplete = this.autocompleterElementFor(this.storyTypesTarget);
7172

72-
if (!taskAutocomplete || !storyAutocomplete) return;
73+
if (!taskAutocomplete || !storyAutocomplete) return;
7374

74-
this.isUpdating = true;
75-
try {
76-
this.syncAutocompleters(storyAutocomplete, taskAutocomplete);
77-
} finally {
78-
this.isUpdating = false;
79-
}
75+
this.isUpdating = true;
76+
try {
77+
this.syncAutocompleters(storyAutocomplete, taskAutocomplete);
78+
} finally {
79+
this.isUpdating = false;
80+
}
81+
}, 0);
8082
};
8183

8284
private onTaskTypeActivated = (_event:CustomEvent) => {
8385
if (this.isUpdating || !this.hasTaskTypeTarget) return;
8486

85-
const taskAutocomplete = this.autocompleterElementFor(this.taskTypeTarget);
86-
const storyAutocomplete = this.autocompleterElementFor(this.storyTypesTarget);
87+
setTimeout(()=> {
88+
const taskAutocomplete = this.autocompleterElementFor(this.taskTypeTarget);
89+
const storyAutocomplete = this.autocompleterElementFor(this.storyTypesTarget);
8790

88-
if (!taskAutocomplete || !storyAutocomplete) return;
91+
if (!taskAutocomplete || !storyAutocomplete) return;
8992

90-
this.isUpdating = true;
91-
try {
92-
this.syncAutocompleters(taskAutocomplete, storyAutocomplete);
93-
} finally {
94-
this.isUpdating = false;
95-
}
93+
this.isUpdating = true;
94+
try {
95+
this.syncAutocompleters(taskAutocomplete, storyAutocomplete);
96+
} finally {
97+
this.isUpdating = false;
98+
}
99+
}, 0);
96100
};
97101

98102
/**

0 commit comments

Comments
 (0)