Skip to content
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

FieldColour colour picker not navigable if current value is not on the palette #2478

Open
1 task done
cpcallen opened this issue Jan 17, 2025 · 1 comment
Open
1 task done
Assignees
Labels
type: bug Something isn't working

Comments

@cpcallen
Copy link
Contributor

Check for duplicates

  • I have searched for similar issues before opening a new one.

Component

@blockly/field-colour

Description

If the current value of of a FieldColour is not one of the colours on the palette in the colour picker, it is not possible to navigate the palette using the cursor keys.

Reproduction steps

  1. Go to the demo page for the field-colour plugin.
  2. Drag the simple colour value block (second block in the toolbox) onto the workspace.
  3. Click on the colour field to open the colour picker.
  4. Use the cursor keys to move the selection around the palette. Note that this works as expected (unless you go to the top-left corner of the grid; see FiledColour colour picker keyboard nav gets stuck in the top left #2477).
  5. Press enter to pick a new colour, or press escape to cancel.
  6. Open the browser's JS console and enter the following code:
    Blockly.getMainWorkspace().getTopBlocks()[0].getField('COLOUR').setValue('#123456');
    
  7. Again click on the colour field to open the colour picker.
  8. Note that now the cursor keys have no effect.
  9. Click on any colour to choose it.
  10. Repeat steps 3–5 and note the picker now responds to cursor keys again.

Stack trace

Screenshots

No response

@cpcallen
Copy link
Contributor Author

Possibly related to #2477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants