File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1580,6 +1580,9 @@ p5.prototype.createSelect = function(...args) {
1580
1580
* @method createRadio
1581
1581
* @return {p5.Element } new <a href="#/p5.Element">p5.Element</a> object.
1582
1582
*/
1583
+
1584
+ //counter for unique names on radio button
1585
+ let counter = 0 ;
1583
1586
p5 . prototype . createRadio = function ( ...args ) {
1584
1587
// Creates a div, adds each option as an individual input inside it.
1585
1588
// If already given with a containerEl, will search for all input[radio]
@@ -1613,7 +1616,7 @@ p5.prototype.createRadio = function(...args) {
1613
1616
}
1614
1617
1615
1618
// Generate a unique name for each radio group if not provided
1616
- self . _name = name || `radioOption_${ p5 . prototype . createRadio . counter ++ } ` ;
1619
+ self . _name = name || `radioOption_${ counter ++ } ` ;
1617
1620
// setup member functions
1618
1621
const isRadioInput = el =>
1619
1622
el instanceof HTMLInputElement && el . type === 'radio' ;
@@ -1739,10 +1742,6 @@ p5.prototype.createRadio = function(...args) {
1739
1742
return self ;
1740
1743
} ;
1741
1744
1742
- // Initialize counter for unique radio group names
1743
- p5 . prototype . createRadio . counter = 0 ;
1744
-
1745
-
1746
1745
/**
1747
1746
* Creates a color picker element.
1748
1747
*
You can’t perform that action at this time.
0 commit comments