Skip to content

Commit 5945e7c

Browse files
authored
fix: Fix bug that prevented keyboard navigation of color swatches. (#2479)
1 parent 243cbee commit 5945e7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/field-colour/src/field_colour.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ export class FieldColour extends Blockly.Field<string> {
475475
* @param dy Change of y.
476476
*/
477477
private moveHighlightBy(dx: number, dy: number) {
478-
if (!this.highlightedIndex) {
478+
if (this.highlightedIndex === null) {
479479
return;
480480
}
481481

@@ -564,7 +564,7 @@ export class FieldColour extends Blockly.Field<string> {
564564
* @returns Highlighted item (null if none).
565565
*/
566566
private getHighlighted(): HTMLElement | null {
567-
if (!this.highlightedIndex) {
567+
if (this.highlightedIndex === null) {
568568
return null;
569569
}
570570

0 commit comments

Comments
 (0)