Commit 463edbd
committed
fix: move drag-and-drop handlers from display:contents wrapper to Tab element (fixes PlatformNetwork/bounty-challenge#21924)
The drag-event handlers (onDragOver, onDragLeave, onDrop) were attached to a
wrapper div with display:contents, which does not generate a CSS box. In
Chromium-based renderers (Tauri WebView2), drag events do not properly fire on
display:contents elements, causing e.preventDefault() to never be called in
handleDragOver. Without that call, the browser treats the area as an invalid
drop zone and shows the not-allowed cursor.
Additionally, dragState() was captured as a stale const inside the <For>
callback body, so isDraggedOver and dropPosition props were frozen at their
initial values and never updated reactively.
Changes:
- Move onDragOver, onDragLeave, onDrop props into the Tab component itself
so they fire on the actual rendered tab div element
- Add ref prop to Tab to pass tabRef for getBoundingClientRect() in
handleDragOver position calculation
- Call dragState() directly in JSX expressions for reactive updates
- Remove the display:contents wrapper div entirely, use fragment (<>)1 parent 96c2652 commit 463edbd
1 file changed
+16
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| |||
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| |||
421 | 425 | | |
422 | 426 | | |
423 | 427 | | |
| 428 | + | |
424 | 429 | | |
425 | 430 | | |
426 | 431 | | |
| |||
432 | 437 | | |
433 | 438 | | |
434 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
435 | 443 | | |
436 | 444 | | |
437 | 445 | | |
| |||
1048 | 1056 | | |
1049 | 1057 | | |
1050 | 1058 | | |
1051 | | - | |
1052 | 1059 | | |
1053 | 1060 | | |
1054 | 1061 | | |
| |||
1062 | 1069 | | |
1063 | 1070 | | |
1064 | 1071 | | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
| 1072 | + | |
1072 | 1073 | | |
| 1074 | + | |
1073 | 1075 | | |
1074 | 1076 | | |
1075 | 1077 | | |
| |||
1096 | 1098 | | |
1097 | 1099 | | |
1098 | 1100 | | |
1099 | | - | |
1100 | | - | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1101 | 1106 | | |
1102 | 1107 | | |
1103 | 1108 | | |
| |||
1114 | 1119 | | |
1115 | 1120 | | |
1116 | 1121 | | |
1117 | | - | |
| 1122 | + | |
1118 | 1123 | | |
1119 | 1124 | | |
1120 | 1125 | | |
| |||
0 commit comments