-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
createCheckbox() without label inserts unnecessary <div> #5422
Comments
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already. |
Please provide some screenshots or code snippets of the generated HTML! |
Here's code + output showing what I think @stigmollerhansen is describing. This: function setup() {
createCanvas( 400, 400 );
let s = createCheckbox( 'label', false );
let f = createInput();
}
function draw() {
} produces this, grouping the checkbox and label in a div: <div>
<input type="checkbox" id="3anqiyphfc8">
<label for="3anqiyphfc8">label</label>
</div>
<input value="" type="text"> This, with no label given to function setup() {
createCanvas( 400, 400 );
let s = createCheckbox();
let f = createInput();
}
function draw() {
} produces this: <div>
<input type="checkbox">
</div>
<input value="" type="text"> I believe @stigmollerhansen is suggesting that if not given a label <input type="checkbox">
<input value="" type="text"> |
Exactly what I meant, @awelles! Thank you for your follow-up code example and for bringing this issue to my attention again. |
@limzykenneth @outofambit A simple workaround would be to add an However, this approach does not seem sufficiently robust nor elegant. Another approach would be to create the surrounding I would greatly appreciate your thoughts on this matter, and I would proceed accordingly. Cheers! |
Using createCheckbox() without specifying a label creates an element wrapped in a
Most appropriate sub-area of p5.js?
Details about the bug:
function setup() {
createCanvas(400, 400);
let s = createCheckbox();
let f = createInput();
}
function draw() {
}
(examine created elements and their associated HTML code with the browser's developer inspector)
The text was updated successfully, but these errors were encountered: