processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.74k stars 3.34k forks source link

multiple elements having same id #3510

Closed Ajayneethikannan closed 5 years ago

Ajayneethikannan commented 5 years ago

Nature of issue?

Most appropriate sub-area of p5.js?

Which platform were you using when you encountered this?

Details about the bug:

New feature details:

For this issue, the changes will be made in the id function defined in the p5.Element.js module The changes:

lmccart commented 5 years ago

I like this warning idea and we're currently thinking about adding some functionality for Friendly Error System that checks the logic of arguments passed in. That's a longer term effort. For now, a good fix might be to add some info to the documentation recommending that only one element have a particular id per sketch, and directing users to look at class() instead.

lmccart commented 5 years ago

resolved with #3534