-
Notifications
You must be signed in to change notification settings - Fork 80
fix(ui): wrap DialogBox in Teleport to fix positioning in drawer cont… #6255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6255 +/- ##
=======================================
Coverage 76.22% 76.22%
=======================================
Files 393 393
Lines 19788 19788
Branches 4743 4743
=======================================
Hits 15084 15084
Misses 4704 4704
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5d78d49 to
2ac7293
Compare
Dialogs spawned from buttons were not centering correctly when rendered within fixed-position containers that use CSS transforms (such as the immersive editor drawer). The transform property creates a new containing block for fixed-position descendants, causing dialogs to position relative to the container instead of the viewport. This change wraps the DialogBox component in Vue 3's Teleport component to always render dialogs at the document body level. This ensures dialogs position correctly relative to the viewport in all contexts. Changes: - Wrapped dialog container in <Teleport to="body"> - Added inheritAttrs: false to prevent attrs being applied to Teleport - Added v-bind="$attrs" to container div to preserve data-el and other attributes for testing and functionality This is the correct, standard solution for modal dialogs in Vue 3 and ensures consistent positioning across the application.
2ac7293 to
c8c05fb
Compare
|
@cstns can you give this a ✅ so we can merge? This is still a problem:
|
|
It has a green light from the get go, but there are a lot of e2e tests that need to be addressed, that's why I haven't ticked it yet |

Description
Dialogs spawned from buttons within the immersive editor drawer were not centering on screen due to CSS positioning context issues. The drawer uses position: fixed with transform properties, which creates a new containing block for fixed-position descendants.
This change wraps the DialogBox component in Vue 3's Teleport component to render dialogs at the document body level, outside the drawer's DOM hierarchy. This ensures dialogs always position relative to the viewport regardless of where they are instantiated.
Related Issue(s)
Follow up from #6253
#6261
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel