Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the target element in INP attribution #479

Merged
merged 1 commit into from May 12, 2024
Merged

Conversation

philipwalton
Copy link
Member

Fixes #456.

Unlike all of the other metrics, for INP there is not a simple 1-to-1 relationship between the element selector in the attribution object, and the element itself in the entries array. This means that, if the selector is not sufficient and you need access to the element itself, it's not possible to get it without re-implementing all of the INP attribution logic, which is non-trivial for INP.

To address this, this PR adds an interactionTargetElement property to the INPAttribution object, which corresponds to the element identified via the interactionTarget property.

interface INPAttribution {
  interactionTarget: string;
+  interactionTargetElement: Node | undefined;
}

Revert changes to LCP and CLS

Revert to just using interactionTarget
@philipwalton philipwalton merged commit a12b628 into v4 May 12, 2024
6 checks passed
@philipwalton philipwalton deleted the target-element2 branch May 12, 2024 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants