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 —
Only call createRadio from select() if the element is a valid radio parent (span or div)
Resolves #6836
Changes:
Adds a check (elt.tagName === 'DIV' || elt.tagName === 'SPAN') before calling createRadio. Other element types will just get a normal p5.Element.
I chose the elt.tagName === syntax because that is what is used in the lines above this. Note that createRadio uses an instanceof check (arg0.elt instanceof HTMLDivElement || arg0.elt instanceof HTMLSpanElement), but the result should be the same.
Only call
createRadio
fromselect()
if the element is a valid radio parent (span or div)Resolves #6836
Changes: Adds a check
(elt.tagName === 'DIV' || elt.tagName === 'SPAN')
before callingcreateRadio
. Other element types will just get a normalp5.Element
.I chose the
elt.tagName ===
syntax because that is what is used in the lines above this. Note thatcreateRadio
uses aninstanceof
check (arg0.elt instanceof HTMLDivElement || arg0.elt instanceof HTMLSpanElement
), but the result should be the same.PR Checklist
npm run lint
passes