Skip to content

Commit d485bb4

Browse files
committed
Document new behavior
1 parent d4839b6 commit d485bb4

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ const Demo = () => {
4141
render(<Demo />);
4242
```
4343

44+
The user can select the item with arrow keys (or hjkl) + enter, or by hitting the number of the option directly.
45+
4446
<img src="media/demo.gif" width="508">
4547

4648
## Props

src/SelectInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ function SelectInput<V>({
137137
}
138138
}
139139

140+
// Enable selection directly from number keys.
140141
if (/^[1-9]$/.test(input)) {
141142
const targetIndex = Number.parseInt(input, 10) - 1;
142143

0 commit comments

Comments
 (0)