processing / processing/p5.js-web-editor
Color Picker closes when keypressed
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 1.7k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 8
Description
p5.js version
1.11.1
What is your operating system?
None
Web browser and version
135.0.7049.41 (Official Build) (arm64)
Actual Behavior
Using the color picker, any keypress in the color picker editable input fields results in the colorpicker closing, making it very easy to create NaN values in the string color representation.
Then, switching between color modes by clicking on the bar results in badly malformed strings:
Expected Behavior
I expect that if a text field looks editable, it is editable. I expect that the color picker can only generate valid colors.
It is still totally possible to recover from error and use all the other features of the color picker, though! In this case, I used it instinctively because it looked possible, but I actually don't think the color picker needs to have editable text fields. This bug feels easy to recover from.
Steps to reproduce
Steps:
- Start with
background('#000')to create color picker button - In color picker, put cursor into any of the RGBA values and press backspace (in my case, color picker dialog disappeared, and then there was a
NaNin the resulting new color value - Open color picker again and use it to change color mode. Can result in things like
hsla(0,0%,0%,NaN)(0,0%,0%,NaN)(0,0,0,NaN)
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 by reproducing the issue in the color picker created from background('#000'), focusing on the editable RGBA fields and the behavior after pressing backspace. Locate the color picker implementation from that entry point, then verify that keypresses no longer close it or produce NaN and malformed color strings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100