Skip to content

Commit 25ee5a9

Browse files
fix: prevent Enter/Space from propagating from Grid (#2570)
This can cause unexpected interactions with the keyboard navigation plugin and potentially other listeners. We also plan to fix keyboard navigation to ignore events during ephemeral focus. See RaspberryPiFoundation/blockly-keyboard-experimentation#618
1 parent d9076a7 commit 25ee5a9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • plugins/field-grid-dropdown/src

plugins/field-grid-dropdown/src/grid.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ export class Grid {
189189
case 'End':
190190
this.moveFocus(this.items.length - 1, false);
191191
break;
192+
case 'Enter':
193+
case 'Space':
194+
// Handled via GridItem click handler, so we want its default but it
195+
// must not propagate.
196+
e.stopPropagation();
197+
return;
192198
default:
193199
// Not a key the grid is interested in.
194200
return;

0 commit comments

Comments
 (0)