createCheckbox() without label inserts unnecessary <div>
Open
Nobody has claimed this yet.
Area:DOM
Bug
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Using createCheckbox() without specifying a label creates an element wrapped in a
. By comparison, createInput() simply inserts an element. For consistency and ease of having to style checkboxes with CSS it would be desireable if createCheckbox() with no label specified behaved like createInput().Most appropriate sub-area of p5.js?
- Accessibility (Web Accessibility)
- Build tools and processes
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Friendly error system
- Image
- IO (Input/Output)
- Localization
- Math
- Unit Testing
- Typography
- Utilities
- WebGL
- Other (specify if possible)
Details about the bug:
- p5.js version: 1.4.0
- Web browser and version: Google Chrome 93.0.4577.82 (Official version) (x86_64)
- Operating System: MacOSX 10.14.6
- Steps to reproduce this:
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the createCheckbox() and createInput() entry points in the p5.js DOM API and reproduce the example in Chrome's developer inspector. Done means createCheckbox() without a label inserts an input without the extra div, while labeled checkboxes continue to behave appropriately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100