Commit f46520d
committed
fix(browser): Keep the first element name captured for an interaction
The INP element-name cache is keyed by the rounded event timestamp and every event of one
interaction shares that timestamp, so the last write won. When a handler swaps out the
element under the cursor, the browser then fires `pointerover`/`mouseover` for the new
element carrying that same timestamp, and those overwrote the cached name with the
post-mutation DOM. An INP span for a click that navigated away was named after the new body
rather than the element that was clicked.
Keeping the first name pins the entry to the element actually interacted with. Chromium 141
happened to round the follow-up events to a different millisecond, which is why this only
surfaced on a newer browser.1 parent 85494a6 commit f46520d
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| |||
0 commit comments