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

This codes brings the observed div into view on load, not desired #48

Open
KKacer opened this issue Feb 26, 2023 · 2 comments
Open

This codes brings the observed div into view on load, not desired #48

KKacer opened this issue Feb 26, 2023 · 2 comments

Comments

@KKacer
Copy link

KKacer commented Feb 26, 2023

Updated, part of the code was not shown in the first post.

First thank you for the great work,

I have 1 issue with the code usage:

Tried this:

<IntersectionObserve> @{var isIntersecting = context.IsIntersecting;} <div @ref="context.Ref.Current" class="wrap @(isIntersecting ? "wrapActive" : "")">

...

The issue is that it always brings the div into the view on load of the page!
Do you know what is causing this or what can be the issue?

Regards!

@KKacer
Copy link
Author

KKacer commented Mar 1, 2023

Updated, part of the code was not shown earlier which I fixed,
Don't know why it scrolls the page to the location where the observed item is.

@ljbc1994
Copy link
Owner

Hi, could you provide a minimal working example for this please?

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

No branches or pull requests

2 participants