Skip to content

Commit

Permalink
improve experience for android mobile keyboard (#1944)
Browse files Browse the repository at this point in the history
* improve experience for android mobile keyboard

* prevent default for all inputEvents
  • Loading branch information
oliverabrahams authored Feb 13, 2025
1 parent 3beaf00 commit fd64061
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libs/@guardian/react-crossword/src/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ export const Grid = () => {

if (nativeEvent instanceof InputEvent) {
const { inputType, data } = nativeEvent;
event.preventDefault();

switch (inputType) {
case 'deleteContentBackward':
Expand All @@ -301,11 +302,9 @@ export const Grid = () => {
case 'insertText':
case 'insertCompositionText':
if (data) {
typeLetter(data);
typeLetter(data.slice(-1));
}
break;
default:
break;
}
}
},
Expand Down

0 comments on commit fd64061

Please sign in to comment.