-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Description
Problem Statement
We are seeing a large number of INP-related spans where the clicked element is reported as <unknown>.
This happens when the user clicks UI elements that immediately disappear from the DOM right after the interaction — most commonly:
- closing buttons (e.g., closing a modal),
- clearing input with an “X” button,
- removing items from lists, cards, etc.
Because these elements are removed, by the time Sentry processes the INP event, e.target is already null, which results in spans showing <unknown> instead of the actual clicked element.
This significantly reduces the usefulness and traceability of INP measurements.
Solution Brainstorm
A potential fix is to capture and cache metadata about the clicked element at the moment of the click event — before the element disappears.
Example approach:
- On click, immediately compute and store the result of
htmlTreeAsString(event.target)(or an equivalent helper used for INP). - When constructing INP spans, use the cached
htmlTreeAsStringvalue instead of trying to readevent.targetagain (which may already be null after DOM removal).
Product Area
Unknown
Metadata
Metadata
Assignees
Projects
Status
Waiting for: Product Owner