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

[Vue Router warn]: Couldn't find element using selector "#Section2" returned by scrollBehavior. #4571

Open
leccyril opened this issue Jul 29, 2023 · 6 comments

Comments

@leccyril
Copy link

Description

on nuxtjs when we scroll section to another section we have this warning what i think cause some method to neot be executed as afterSlideLoad, but when we put directly anchor in url the method is executed

Link to isolated reproduction with no external CSS / JS

Link to reproduce

Steps to reproduce it

1 open console debugger
2 scroll fron first section to another
3 check console log

Versions

any version of nuxt3

the issue is as i want to execute some code on afterSlideLoad, it is not working

see this question : stack overflow

@alvarotrigo
Copy link
Owner

I can see the callback firing:
image

@leccyril
Copy link
Author

Hi,

i am sorry but on the first display nothing happen, it makes the callback only when clicking on arrow, but how for the first call ? the first display of first slide ?

@leccyril
Copy link
Author

i have a simple case, i dont want to display any arrows on the first left slide, only on the following, only when we are in next slide, have the "back" arrow slide.

@alvarotrigo
Copy link
Owner

but how for the first call ? the first display of first slide ?

The first slide won't trigger afterSlideLoad.
But it will trigger afterLoad.

You can see this on the example online:
https://alvarotrigo.com/fullPage/examples/callbacks.html#secondPage

@leccyril
Copy link
Author

leccyril commented Aug 22, 2023

So in my updated example 2 errors

1 on the afterLoad method it log twice the anchor section1 event if we are in section2

2 onafterlideLoad i am always on right direction :
on section 1 i click on the arrow on right , direction == right, but then if i click on the left arrow on left direction is still right in log

@alvarotrigo
Copy link
Owner

1 on the afterLoad method it log twice the anchor section1 event if we are in section2

See the docs regarding the afterLoad callback. Your parameters are in the wrong order. They should be:

    afterLoad: function(origin, destination, direction, trigger){},

2 onafterlideLoad i am always on right direction :
on section 1 i click on the arrow on right , direction == right, but then if i click on the left arrow on left direction is still right in log

I'm not able to reproduce the issue.
Try updating to the latest "@fullpage/nuxt-fullpage": "^0.2.5".
You are currently using version 0.2.4.

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

No branches or pull requests

2 participants