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

error in docs example #1654

Open
ghost opened this issue Jun 9, 2023 · 1 comment
Open

error in docs example #1654

ghost opened this issue Jun 9, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 9, 2023

Here is an example from the docs, but this seem wrong as I`m getting an error when running on my local.
This example: https://codepen.io/desandro/pen/LYpbOL

When click on "number > 50" or "name ends with –ium" getting this error.
error: "index.js:13 Uncaught TypeError: itemElem.querySelector is not a function "

I`m using villana js...

CDN`s:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js" i></script>
@thesublimeobject
Copy link
Collaborator

@Mateen-Aslam — I assume you copied the example directly to some local instance? Without a reduced test case it's going to be hard to tell exactly what is going on since the example does work in the CodePen. That said, I do know that there's a known issue with some of the filter/sort functions returning arguments that don't correspond directly to the documentation. Unfortunately, I can't recall off the top of my head what the issue was (nor can I find the issue at this moment).

I would debug/console.log() out the arguments for the sorting function and see what you get back. If I remember correctly, it's something like the function actually returns two arguments, and the first one is null but the second argument is actually the element that is needed to query for the sorting function. It might be slightly different, but if you mess with it you should be able to see what I'm talking about.

If this doesn't help, please follow up and I should be able to dig into it a bit more when I get some more time.

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

No branches or pull requests

1 participant