Skip to content

Commit

Permalink
fix for keydown, was preventing default for all keys including tab - …
Browse files Browse the repository at this point in the history
…We only want to prevent default for keys which have length 1
  • Loading branch information
oliverabrahams committed Jan 23, 2025
1 parent 8c215b4 commit e5aaed9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/@guardian/react-crossword/src/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ export const Grid = () => {
const handleKeyDown = useCallback(
(event: KeyboardEvent<HTMLInputElement>) => {
if (event.key === 'Backspace' || event.key === 'Delete') {
event.preventDefault();
if ('value' in event.target && isString(event.target.value)) {
event.preventDefault();
deleteLetter(event.target.value);
}
} else {
Expand Down

0 comments on commit e5aaed9

Please sign in to comment.