fix(ui): wrap DialogBox in Teleport to fix positioning in drawer cont…#6255
Open
fix(ui): wrap DialogBox in Teleport to fix positioning in drawer cont…#6255
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6255 +/- ##
=======================================
Coverage 76.42% 76.42%
=======================================
Files 396 396
Lines 19885 19885
Branches 4766 4766
=======================================
Hits 15198 15198
Misses 4687 4687
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:
|
Contributor
Author
5d78d49 to
2ac7293
Compare
Contributor
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
Contributor
Author
|
@cstns can you give this a ✅ so we can merge? This is still a problem:
|
Contributor
|
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 |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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