Commit d9fc9cc
committed
fix(react-drag-drop): support dynamic root element IDs in DragDropContainer
Fixes #12217
- Replace hardcoded document.getElementById('root') with dynamic root element lookup
- Add getRootElement() helper that tries common root IDs: 'root', 'app', 'main', '__next'
- Fallback to document.body if no common root element is found
- Enables usage in applications with non-standard root element IDs (e.g., id="app")
This fix allows OCP 4.22 and other applications to use @patternfly/react-drag-drop
regardless of their React root element configuration.1 parent d589d3a commit d9fc9cc
File tree
1 file changed
+16
-1
lines changed- packages/react-drag-drop/src/components/DragDrop
1 file changed
+16
-1
lines changedLines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
291 | 306 | | |
292 | 307 | | |
293 | 308 | | |
| |||
299 | 314 | | |
300 | 315 | | |
301 | 316 | | |
302 | | - | |
| 317 | + | |
303 | 318 | | |
304 | 319 | | |
305 | 320 | | |
| |||
0 commit comments