glidejs / glide

A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more
https://glidejs.com
MIT License
7.21k stars 769 forks source link

Firefox doesn't recognize [data-glide-el="track"] attribute on loading #694

Open Epizefiri opened 5 days ago

Epizefiri commented 5 days ago

Hello there, I'm developing a solution to use Glide.js inside Grapes.js ( A nice block editor ).

Grape.js is using iFrames, when i try to load a slider inside an iFrame I get these two errors on my firefox console

[Glide warn]: Could not find track element. Please use [data-glide-el="track"] attribute.

and

Uncaught TypeError: i.track is undefined

This is weird because the attribute is in the correct position ( and everything works on Chrome ).

If i remove the condition

if (exist(t)) { on row 1610 of glide.js 3.6.1 my sliders are working fine.

Epizefiri commented 5 days ago

https://github.com/glidejs/glide/pull/675 I see that the same condition have been discussed here

jedrzejchalubek commented 5 days ago

@Epizefiri Could you prepare MR that removes this exist check entirely? It was purely for development experience to provide a nice error instead of "something is undefined" but it looks like it causes more troubles

Epizefiri commented 5 days ago

@germandmg did it for me https://github.com/glidejs/glide/pull/695