Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add selectFocusedOnSubmit option #11

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

akuntsch
Copy link
Contributor

@akuntsch akuntsch commented Dec 13, 2024

Add an option to automatically select the currently focused option when pressing enter and no other options are already selected (when multiple=true).

@jeffwcx
Copy link
Owner

jeffwcx commented Dec 14, 2024

Is there any use case for this feature? In my opinion, it's better to set a default value. @akuntsch

@akuntsch
Copy link
Contributor Author

akuntsch commented Dec 14, 2024

Is there any use case for this feature? In my opinion, it's better to set a default value. @akuntsch

For me (and my team) there is, yes. We have a prompt with a big list of dynamic options and quite often you only want to select a single one but not always the same one (so a default value would not make sense).
With this option it basically saves an extra keypress and it also does not break anything with the default value.

@jeffwcx
Copy link
Owner

jeffwcx commented Dec 14, 2024

That make sense. Can you add a test case?

@akuntsch akuntsch force-pushed the feature/auto-select-focused branch from 12103bd to 3d6fad5 Compare December 14, 2024 08:48
@jeffwcx jeffwcx merged commit 614c6da into jeffwcx:main Dec 14, 2024
13 checks passed
@jeffwcx
Copy link
Owner

jeffwcx commented Dec 14, 2024

Released in 1.0.0-alpha.9. @akuntsch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants