Skip to content

Commit

Permalink
Fix tab key incorrectly having ctrl equal to true
Browse files Browse the repository at this point in the history
Related to #512.
  • Loading branch information
vadimdemedes committed Mar 28, 2023
1 parent 09261d5 commit 26b8364
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hooks/use-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const useInput = (inputHandler: Handler, options: Options = {}) => {
};

// Copied from `keypress` module
if (input <= '\u001A' && !key.return) {
if (input <= '\u001A' && !key.return && !key.tab) {
// eslint-disable-next-line unicorn/prefer-code-point
input = String.fromCharCode(
// eslint-disable-next-line unicorn/prefer-code-point
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/use-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function UserInput({test}: {test: string | undefined}) {
return;
}

if (test === 'tab' && input === '' && key.tab) {
if (test === 'tab' && input === '' && key.tab && !key.ctrl) {
exit();
return;
}
Expand Down

0 comments on commit 26b8364

Please sign in to comment.