Skip to content

radio.selected(value) does not work with radio buttons holding "value" and "label" #5374

@KouichiMatsuda

Description

@KouichiMatsuda

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: Chrome and 92.0.4515.131 (Official Build) (64 bit) (cohort: Stable)
  • Operating System: Windows 10
  • Steps to reproduce this:

Hi all,
In the following code, the "red" button is not selected. Am I missing something?

let radio; 

function setup() {
  radio = createRadio(); 
  radio.option(1, "red"); 
  radio.option(2, "blue"); 
  radio.option(3, "green");
  radio.selected(1); 
}

function draw() {

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions