From edf11fb5cdd74710dcd42caf3eba2bc71dac6209 Mon Sep 17 00:00:00 2001 From: Linda Paiste Date: Sat, 9 Mar 2024 15:20:00 -0600 Subject: [PATCH] Only call `createRadio` from `select()` if the element is a valid radio parent --- src/dom/dom.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dom/dom.js b/src/dom/dom.js index ad19e8fbd4..f1084a74a8 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -229,7 +229,8 @@ p5.prototype._wrapElement = function (elt) { children.length > 0 && children.every(function (c) { return c.tagName === 'INPUT' || c.tagName === 'LABEL'; - }) + }) && + (elt.tagName === 'DIV' || elt.tagName === 'SPAN') ) { return this.createRadio(new p5.Element(elt, this)); } else {