aws-amplify / aws-amplify/amplify-cli

unable to select option after filtering single-select prompt

Open
#11,521 1 comment 0 reactions 0 assignees View on GitHub
bug p2 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/dev/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

pnpm

### If applicable, what version of Node.js are you using?

18

### Amplify CLI Version

10.5.1

### What operating system are you using?

mac

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

n/a

### Amplify Categories

Not applicable

### Amplify Commands

Not applicable

### Describe the bug

I ran into this using the API category with REST API's, but I have run into similar issues in the passed elsewhere in the CLI. In a filterable, single-select prompt once you type a character(s) that filters the list to no available options, then backspace to view all options again you are unable to proceed and select an option using the arrow keys.

### Expected behavior

We are able to select an option

### Reproduction steps

1. `amplify init -y`
2. `amplify add api` > REST API
3. follow the prompts until you get to "Restrict API Access"
4. select "Yes"
5. filter with "lu"
6. observe no results
7. backspace to view all results again
8. observe unable to select with arrow keys

You must ctrl+c to exit flow

```
✔ Restrict API access? (Y/n) · yes
✖ Restrict access by: · lu
🛑 There was an error adding the API resource
```

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Project Identifier

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with `amplify init -y` and `amplify add api`, then follow the prompts to “Restrict API Access” and filter with `lu` before backspacing. Trace the single-select prompt entry point used by this flow; done means options can be restored and selected with the arrow keys without exiting the CLI.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.