kenwheeler / slick

the last carousel you'll ever need
kenwheeler.github.io/slick
MIT License
28.5k stars 5.88k forks source link

Found elements with non-unique id # #4125

Open laxman-ghavte opened 3 years ago

laxman-ghavte commented 3 years ago

If crousel has form input elements like textbox and submit button then with infinite true option getting console errro "[DOM] found X elements with non-unique id #"

laxman-ghavte commented 3 years ago

Solution Insted if no Id, we can set some randome id. .attr('id', '') can be replaced with .attr('id', Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5))

PR: https://github.com/kenwheeler/slick/pull/4126