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

Unsupported pseudo: visible #476

Closed
fiote opened this issue Mar 16, 2021 · 2 comments
Closed

Unsupported pseudo: visible #476

fiote opened this issue Mar 16, 2021 · 2 comments

Comments

@fiote
Copy link

fiote commented Mar 16, 2021

I'm using Sizzle as a standalone lib without jquery (cloned the git, npm run builded it and included the min.js file on my project).

For most part it works great, but I'm trying to use the :visible pseudo-selector and it's saying it's not supported. Is there some parameter/option I need to set/enable to make it work when building the project or something like that?

@timmywil
Copy link
Member

:visible is actually a custom pseudo selector added by jQuery. However, you can add this yourself without adding the rest of jQuery. See https://github.com/jquery/jquery/blob/main/src/css/hiddenVisibleSelectors.js

Sizzle.selectors.pseudo.visible = function visibleSelector( elem ) {
  return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
}

@fiote
Copy link
Author

fiote commented Mar 16, 2021

Thanks a LOT @timmywil \o/

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

2 participants