Skip to content

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

@FrancescoMessage

Description

@FrancescoMessage

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions