Commit 4ae47f8
fix: make spreadsheet overlays native popover, per instance (#9303)
The spreadsheet attaches a `<div id="spreadsheet-overlays">` to host its
overlay widgets (context menu, tooltips, comment overlays, popup
buttons). It has historically lived in `<body>` to escape clipping by
ancestor `overflow`/`transform` rules and as a singleton shared by all
spreadsheet instances on the page. Switching the overlays to native
popover changes the picture: every overlay enters the top layer
regardless of DOM position, so neither the body-attachment nor the
singleton are load-bearing anymore.
This PR includes the native popover changes proposed in #9270 and adds
the structural changes that the popover approach enables:
- the container moves into the `<vaadin-spreadsheet>` light DOM,
projected into the shadow root via a new `overlays` slot, with one
container per instance;
- the reference is threaded from JS into the GWT widget chain instead of
being looked up by id;
- `SpreadsheetConnector` — not `ApplicationConnection` — now owns the
`SpreadsheetContextMenu`.
Tooltips and the cell-comment overlay are created in `SheetWidget`'s
constructor (before the host is known), so the container is wired in via
a setter rather than a constructor argument.
A side benefit: spreadsheet overlays inside a modal `Dialog` are
interactive again. The modal sets `body { pointer-events: none }` to
disable everything outside the dialog overlay; with the container now
inside the dialog's slotted content, the overlays inherit
`pointer-events: auto` from the dialog's overlay part instead of
`pointer-events: none` from `<body>`.
Intended to replace #9270.
Related to #9270
---
🤖 Generated with Claude Code
---------
Co-authored-by: Tatu Lund <tatu@vaadin.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c551e99 commit 4ae47f8
14 files changed
Lines changed: 296 additions & 49 deletions
File tree
- vaadin-spreadsheet-flow-parent
- vaadin-spreadsheet-flow-client/src
- main/java/com/vaadin
- addon/spreadsheet/client
- client
- component/spreadsheet/client/js
- test/java/com/vaadin/component/spreadsheet/client/js
- vaadin-spreadsheet-flow-integration-tests/src
- main/java/com/vaadin/flow/component/spreadsheet/tests
- test/java/com/vaadin/flow/component/spreadsheet/test
- vaadin-spreadsheet-flow/src/main/resources/META-INF/resources/frontend/vaadin-spreadsheet
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | | - | |
| 62 | + | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| |||
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
576 | 575 | | |
577 | 576 | | |
578 | 577 | | |
579 | | - | |
| 578 | + | |
580 | 579 | | |
581 | 580 | | |
582 | 581 | | |
| |||
859 | 858 | | |
860 | 859 | | |
861 | 860 | | |
| 861 | + | |
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
| |||
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
| |||
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
120 | | - | |
| 119 | + | |
121 | 120 | | |
122 | | - | |
| 121 | + | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
| |||
385 | 384 | | |
386 | 385 | | |
387 | 386 | | |
| 387 | + | |
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| |||
4153 | 4153 | | |
4154 | 4154 | | |
4155 | 4155 | | |
| 4156 | + | |
4156 | 4157 | | |
4157 | 4158 | | |
4158 | 4159 | | |
| |||
6958 | 6959 | | |
6959 | 6960 | | |
6960 | 6961 | | |
6961 | | - | |
| 6962 | + | |
| 6963 | + | |
6962 | 6964 | | |
6963 | 6965 | | |
| 6966 | + | |
| 6967 | + | |
| 6968 | + | |
| 6969 | + | |
| 6970 | + | |
| 6971 | + | |
| 6972 | + | |
| 6973 | + | |
| 6974 | + | |
| 6975 | + | |
6964 | 6976 | | |
6965 | 6977 | | |
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| |||
610 | 614 | | |
611 | 615 | | |
612 | 616 | | |
613 | | - | |
| 617 | + | |
| 618 | + | |
614 | 619 | | |
615 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
616 | 626 | | |
617 | 627 | | |
Lines changed: 69 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | | - | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
19 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | | - | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
24 | 31 | | |
25 | | - | |
26 | | - | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
30 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
31 | 54 | | |
32 | 55 | | |
33 | 56 | | |
34 | | - | |
35 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
36 | 60 | | |
37 | 61 | | |
38 | 62 | | |
39 | 63 | | |
40 | 64 | | |
| 65 | + | |
41 | 66 | | |
42 | 67 | | |
43 | 68 | | |
44 | 69 | | |
| 70 | + | |
45 | 71 | | |
46 | 72 | | |
47 | 73 | | |
48 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
49 | 85 | | |
50 | 86 | | |
51 | 87 | | |
52 | | - | |
53 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
54 | 91 | | |
55 | 92 | | |
56 | | - | |
57 | | - | |
58 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
59 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
60 | 114 | | |
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2212 | 2212 | | |
2213 | 2213 | | |
2214 | 2214 | | |
2215 | | - | |
2216 | | - | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
2217 | 2218 | | |
2218 | 2219 | | |
2219 | 2220 | | |
| |||
Lines changed: 16 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
853 | 852 | | |
854 | 853 | | |
855 | 854 | | |
856 | | - | |
| 855 | + | |
| 856 | + | |
857 | 857 | | |
858 | | - | |
| 858 | + | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | 861 | | |
866 | 862 | | |
867 | 863 | | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
868 | 877 | | |
869 | 878 | | |
870 | 879 | | |
| |||
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | | - | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | | - | |
| 68 | + | |
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
67 | | - | |
| 72 | + | |
68 | 73 | | |
69 | | - | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
0 commit comments