Skip to content

Commit

Permalink
Blur and refocus input box when entering letters this fixes the Andri…
Browse files Browse the repository at this point in the history
…od issue with the keyboard so that when hitting backspace the keys are removed correctly
  • Loading branch information
oliverabrahams committed Dec 16, 2024
1 parent c2b16ed commit ce68029
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/@guardian/react-crossword/src/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ export const Grid = () => {
: keyDownRegex.test(key) && key.toUpperCase();

if (value) {
// This mimics moving to a new input cell after typing a letter
inputRef.current?.blur();
inputRef.current?.focus();

updateCell({
x: currentCell.x,
y: currentCell.y,
Expand Down

0 comments on commit ce68029

Please sign in to comment.