-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
In the radio buttons, the option()'s two arguments are reversed. #4948
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. |
Hi @dongjoon9331, to clarify, do you mean the behaviour in the library isn't what you expected or the documentation example isn't what you expected? At further down the page the documentation for the
The Basically from what I see the behaviour of the code is as I expected, unless you mean the |
In previous versions of p5.js, it worked as .option([label], value). In the second example, the name of the food is printed as the price. This obviously means that the order of the .option() arguments has changed. If you replace the p5.js library without knowing this, you will surely get an error in your program. |
The problem is that it was used as .option ([label], value) in previous versions. |
The changes to @dongjoon9331 For sketches before then, especially before p5.dom.js is merged into the core library, the p5.js version is differentiated by a major version so breaking changes can occur so no guaranteed can be made about code written for p5.js 0.x versions to be fully compatible with code written for p5.js 1.x versions. |
@limzykenneth Okay, I see. |
@limzykenneth thanks for the clarification. while it is a breaking change, it looks like it was made to support the optional second argument, which makes sense to me. I'd suggest we keep as is, but update the example in the documentation to make more sense (flip the strings and numbers in the |
Updating example and documentation related to processing#4948. The label and the value parameters are swapped in the latest implementation of radio() (processing#4430)
Most appropriate sub-area of p5.js?
Details about the bug:
In the radio buttons, the parameters of the option() are applied interchanged.
This error is occurring in the latest version of p5.js.
To see what the error occurs, refer to the url below.
https://p5js.org/ko/reference/#/p5/createRadio
In this example, the amount is displayed where the name of the food should appear.
The text was updated successfully, but these errors were encountered: