-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Undefined method slice when clicking on a specific slider bullet. #371
Comments
Getting this error too, when trying to call |
Nevermind, it was because I was clicking a button I have included inside the Maybe it can give you any tips, @tylercrocker |
@tylercrocker I am facing the same issue. Can you please share your solution? |
I'm getting this error too :/ |
I figured out the reason for my case: |
I'm seeing the following error when clicking on individual slider bullet:
glide.esm.js:2046 Uncaught TypeError: Cannot read property 'slice' of null
This is because the event bubbles up to the slider parent during the following event handler (
glide.esm.js:3242
):event.currentTarget.getAttribute('data-glide-dir')
returns nothing, sinceevent.currentTarget
doesn't have that attribute, and then the resolve method atglide.esm.js:2045
immediately attempts to callslice(0, 1)
on the null object it was passed, and therefore breaks.While the overarching click event DOES WORK, having this JS error happen is rather silly. Could we have the resolve function verify that it does indeed have something before trying to call slice, the initial offending click event not call resolve if it would pass it nothing, or have the click event not bubble?
Thanks!
(P.S. - I'm more than happy to open a PR for this, I just am not super familiar with the codebase and don't want to make any assumptions about your best practices!)
The text was updated successfully, but these errors were encountered: