From 5945e7c0412faedc08c422f9f538ef22193cc659 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 21 Jan 2025 07:00:40 -0800 Subject: [PATCH] fix: Fix bug that prevented keyboard navigation of color swatches. (#2479) --- plugins/field-colour/src/field_colour.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }