Skip to content

Commit 5729faf

Browse files
authored
removed radio button attachment.
1 parent ae61e7b commit 5729faf

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/dom/dom.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,9 @@ p5.prototype.createSelect = function(...args) {
15801580
* @method createRadio
15811581
* @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
15821582
*/
1583+
1584+
//counter for unique names on radio button
1585+
let counter = 0;
15831586
p5.prototype.createRadio = function(...args) {
15841587
// Creates a div, adds each option as an individual input inside it.
15851588
// If already given with a containerEl, will search for all input[radio]
@@ -1613,7 +1616,7 @@ p5.prototype.createRadio = function(...args) {
16131616
}
16141617

16151618
// 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++}`;
16171620
// setup member functions
16181621
const isRadioInput = el =>
16191622
el instanceof HTMLInputElement && el.type === 'radio';
@@ -1739,10 +1742,6 @@ p5.prototype.createRadio = function(...args) {
17391742
return self;
17401743
};
17411744

1742-
// Initialize counter for unique radio group names
1743-
p5.prototype.createRadio.counter = 0;
1744-
1745-
17461745
/**
17471746
* Creates a color picker element.
17481747
*

0 commit comments

Comments
 (0)