processing / processing/p5.js

createCheckbox() without label inserts unnecessary <div>

Open
#5,422 5 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.