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

getPanelByElement function called passing an element instead of an array #4653

Closed
FrancescoMessage opened this issue Sep 5, 2024 · 3 comments

Comments

@FrancescoMessage
Copy link

FrancescoMessage commented Sep 5, 2024

Hi, in Fullpage.js V 4.0.28 sometimes I have this javascript error if I load the page to a specific anchor (section):

Uncaught TypeError: panels.find is not a function

in this function:

function getPanelByElement(panels, el) {
      return panels.find(function (panel) {
        return panel.item === el;
      });
    }

I noticed that in this version, this line of code is added (d309822#diff-3f4acb3a8da52427effb980e67bb24e6f2092f287d69c9db90dfe35b953d4d25):

lazyLoadPanels(getPanelByElement(section));

getPanelByElement function expects an array as argument, but a single element is given in this case, so the error occurs.

@alvarotrigo
Copy link
Owner

alvarotrigo commented Sep 5, 2024

Thanks for reporting it! 👍
I was able to reproduce it here:

https://codepen.io/alvarotrigo/pen/wvLQOEK

Fixed on dev! 🥳

You can try it out using

npm install "https://github.com/alvarotrigo/fullPage.js.git#dev" --save

@FrancescoMessage FrancescoMessage changed the title getPanelByElement function called passing an element insted of an array getPanelByElement function called passing an element instead of an array Sep 5, 2024
@alvarotrigo
Copy link
Owner

Fixed in fullPage.js 4.0.29! 🥳

@FrancescoMessage
Copy link
Author

Well done!

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