We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3202395 commit 58223c9Copy full SHA for 58223c9
packages/select/src/index.ts
@@ -22,13 +22,17 @@ type SelectConfig = AsyncPromptConfig & {
22
23
export default createPrompt<string, SelectConfig>((config, done) => {
24
const { choices } = config;
25
+ const startIndex = Math.max(
26
+ choices.findIndex(({ disabled }) => !disabled),
27
+ 0
28
+ );
29
30
const paginator = useRef(new Paginator()).current;
31
const firstRender = useRef(true);
32
33
const prefix = usePrefix();
34
const [status, setStatus] = useState('pending');
- const [cursorPosition, setCursorPos] = useState(0);
35
+ const [cursorPosition, setCursorPos] = useState(startIndex);
36
37
useKeypress((key) => {
38
if (isEnterKey(key)) {
0 commit comments