blockly-samples icon indicating copy to clipboard operation
blockly-samples copied to clipboard

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

Open cpcallen opened this issue 10 months ago • 1 comments
trafficstars

Check for duplicates

  • [x] 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 #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 avatar Jan 17 '25 16:01 cpcallen

Possibly related to #2477

cpcallen avatar Jan 17 '25 17:01 cpcallen