Most appropriate sub-area of p5.js?
p5.js version
2.3.1
Web browser and version
firefox 155.0
Operating system
linux fedora
Steps to reproduce this
Steps:
- Create a radio using
createRadio().
- Add a couple of options.
- Call
radio.remove().
Snippet:
let radio;
function setup() {
createCanvas(400, 400);
radio = createRadio();
radio.option('Option 1');
radio.option('Option 2');
radio.position(20, 20);
}
function mousePressed() {
radio.remove();
}
Expected behavior:
Calling radio.remove() should remove the radio element from the page, like remove() does for other p5.Elements.
Actual behavior:
The radio stays on the page and isn't removed.
I noticed that createRadio() has its own remove(value) method for removing individual options. This seems to shadow the remove() inherited from p5.Element.
So radio.remove('Option 1') works as expected, but calling radio.remove() without an argument doesn't remove the radio element.
The same thing also seems to happen with removeElements(), where the radio element is left behind.
Most appropriate sub-area of p5.js?
p5.js version
2.3.1
Web browser and version
firefox 155.0
Operating system
linux fedora
Steps to reproduce this
Steps:
createRadio().radio.remove().Snippet:
Expected behavior:
Calling
radio.remove()should remove the radio element from the page, likeremove()does for otherp5.Elements.Actual behavior:
The radio stays on the page and isn't removed.
I noticed that
createRadio()has its ownremove(value)method for removing individual options. This seems to shadow theremove()inherited fromp5.Element.So
radio.remove('Option 1')works as expected, but callingradio.remove()without an argument doesn't remove the radio element.The same thing also seems to happen with
removeElements(), where the radio element is left behind.