Commit d887c2d
committed
fix(v7-q12): HelpModal via createPortal(document.body) escapes transformed ancestors
The help popup was being positioned relative to the Palette tile (or
any other transformed ancestor like React Flow canvas) instead of the
viewport. Per CSS spec, position:fixed is relative to the nearest
*transformed* ancestor, not always the viewport — so React Flow's
.react-flow__viewport (with transform: translate/scale) re-rooted the
fixed-position frame and the modal landed inside whatever node hosted
the ? icon.
Fix: render the modal markup via createPortal(modal, document.body)
so the DOM tree is reparented to <body>, where no transform ancestor
exists. SSR / test envs without document fall back to inline render.
Tests (vbgui/tests/HelpModalPortal.test.tsx, 2/2 PASS):
- opening a brick ? mounts the modal under document.body, NOT inside
the Palette aside or the render container
- opening an adapter ? portals out the same way
Regression: vbgui vitest 509 -> 511 (+2) PASS.1 parent 70792af commit d887c2d
2 files changed
Lines changed: 43 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
930 | 931 | | |
931 | 932 | | |
932 | 933 | | |
933 | | - | |
934 | | - | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
935 | 941 | | |
936 | 942 | | |
937 | 943 | | |
| |||
1158 | 1164 | | |
1159 | 1165 | | |
1160 | 1166 | | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
1161 | 1171 | | |
1162 | 1172 | | |
1163 | 1173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments