fix: colour from colour picker not being updated (#7584)

* fix: colour from colour picker not being updated

* chore: clarify what code is doing
This commit is contained in:
Beka Westberg
2023-10-09 10:34:06 -07:00
committed by GitHub
parent ed3decbb37
commit ab3bc6c3d8

View File

@@ -246,12 +246,9 @@ export class FieldColour extends Field<string> {
const block = this.getSourceBlock() as BlockSvg | null; const block = this.getSourceBlock() as BlockSvg | null;
if (!block) throw new UnattachedFieldError(); if (!block) throw new UnattachedFieldError();
// In general, do *not* let fields control the color of blocks. Having the // Calling applyColour updates the UI (full-block vs non-full-block) for the
// field control the color is unexpected, and could have performance // colour field, and the colour of the field/block.
// impacts. block.applyColour();
// Whenever we render, the field may no longer be a full-block-field so
// we need to update the colour.
if (this.getConstants()!.FIELD_COLOUR_FULL_BLOCK) block.applyColour();
} }
/** /**