Skip to content

Commit 2e266e1

Browse files
committed
Update useInput() to include name in key
Some key values (e.g. 'insert', 'home', 'end') were basically lost. In these cases, the `input` value would be an empty string and the generated `key` data would contain no additional information about the value. To resolve this, directly include `keypress.name` in the generated `key` data so this information is not lost.
1 parent 73795c4 commit 2e266e1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/hooks/use-input.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ const useInput = (inputHandler: Handler, options: Options = {}) => {
140140
const keypress = parseKeypress(data);
141141

142142
const key = {
143+
name: keypress.name,
143144
upArrow: keypress.name === 'up',
144145
downArrow: keypress.name === 'down',
145146
leftArrow: keypress.name === 'left',

0 commit comments

Comments
 (0)