Skip to content

Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element' #44

Description

@indieza

Hello,

I got the following error in the console after the execution of the logic after checking is the current item is observed.

Microsoft.JSInterop.JSException: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'.
TypeError: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'.

I apply the code which I use.

<div @ref="@this.Reference">
    Some data
</div>

public ElementReference Reference { get; set; } = new ElementReference(Guid.NewGuid().ToString());

await ObserverService.Observe(Reference, async (entries) =>
{
    if (entries.FirstOrDefault().IsIntersecting)
    {
        // Login execution
    }
});

Regards,
Simeon Valev

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions