Skip to content

Commit f2fc71a

Browse files
committed
fix: colour from colour picker not being updated (#7584)
* fix: colour from colour picker not being updated * chore: clarify what code is doing
1 parent ead46e7 commit f2fc71a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

core/field_colour.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,9 @@ export class FieldColour extends Field<string> {
246246

247247
const block = this.getSourceBlock() as BlockSvg | null;
248248
if (!block) throw new UnattachedFieldError();
249-
// In general, do *not* let fields control the color of blocks. Having the
250-
// field control the color is unexpected, and could have performance
251-
// impacts.
252-
// Whenever we render, the field may no longer be a full-block-field so
253-
// we need to update the colour.
254-
if (this.getConstants()!.FIELD_COLOUR_FULL_BLOCK) block.applyColour();
249+
// Calling applyColour updates the UI (full-block vs non-full-block) for the
250+
// colour field, and the colour of the field/block.
251+
block.applyColour();
255252
}
256253

257254
/**

0 commit comments

Comments
 (0)