diff --git a/plugins/field-colour/src/field_colour.ts b/plugins/field-colour/src/field_colour.ts index dc5c88dfe..0e05fbb5c 100644 --- a/plugins/field-colour/src/field_colour.ts +++ b/plugins/field-colour/src/field_colour.ts @@ -475,7 +475,7 @@ export class FieldColour extends Blockly.Field { * @param dy Change of y. */ private moveHighlightBy(dx: number, dy: number) { - if (!this.highlightedIndex) { + if (this.highlightedIndex === null) { return; } @@ -564,7 +564,7 @@ export class FieldColour extends Blockly.Field { * @returns Highlighted item (null if none). */ private getHighlighted(): HTMLElement | null { - if (!this.highlightedIndex) { + if (this.highlightedIndex === null) { return null; }