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

Force reflowing of the dialog content

Oliver Günther353a97b8b0a7
diff --git a/frontend/src/turbo/dialog-stream-action.ts b/frontend/src/turbo/dialog-stream-action.ts
index 5dc75ceaff9..fa26d05c3ac 100644
--- a/frontend/src/turbo/dialog-stream-action.ts
+++ b/frontend/src/turbo/dialog-stream-action.ts
@@ -5,6 +5,9 @@ export function registerDialogStreamAction() {
const content = this.templateElement.content;
const parent = content.firstElementChild as HTMLElement;
const dialog = content.querySelector('dialog') as HTMLDialogElement;
+ // Set a temporary width so the dialog reflows after opening
+ dialog.style.width = '0px';
+
document.body.append(content);
// Auto-show the modal
@@ -12,5 +15,9 @@ export function registerDialogStreamAction() {
// Remove the element on close
dialog.addEventListener('close', () => parent.remove());
+
+ setTimeout(() => {
+ dialog.style.removeProperty('width');
+ }, 10);
};
}