Commit 4c90cd2
authored
fix(website): fix tooltip on edit page (#6628)
resolves #6627
From claude:
I found the root cause. It's a bug in react-tooltip v6's
resolveDataTooltipAnchor function:
⏺ There's the bug. Line 259 checks currentElement instanceof HTMLElement
— but SVG elements are SVGElement, not
HTMLElement. So when data-tooltip-id is on the
<MaterialSymbolsInfoOutline> (which renders as an <svg>), the library
walks up the DOM tree and skips the SVG element entirely, never finding
the anchor.
The fix is to put data-tooltip-id on a wrapping <span> instead of on the
SVG icon directly — exactly the pattern HoverTooltip already uses.
### Screenshot
### PR Checklist
- [ ] All necessary documentation has been adapted.
- [ ] The implemented feature is covered by appropriate, automated
tests.
- [ ] Any manual testing that has been done is documented (i.e. what
exactly was tested?)
🚀 Preview: https://tooltip.loculus.org1 parent fabc333 commit 4c90cd2
2 files changed
Lines changed: 23 additions & 3 deletions
File tree
- integration-tests/tests/specs/features
- website/src/components/Edit
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
0 commit comments