Skip to content

Commit

Permalink
Update packages/checkbox/src/index.mts
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias authored Oct 15, 2023
1 parent 4c390f5 commit 6fde1d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/checkbox/src/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default createPrompt(

useKeypress((key) => {
if (isEnterKey(key)) {
if (required && items.filter(isChecked).length === 0) {
if (required && !items.some(isChecked)) {
setError('At least one choice must be selected');
} else {
setStatus('done');
Expand Down

0 comments on commit 6fde1d6

Please sign in to comment.