diff --git a/packages/checkbox/src/index.mts b/packages/checkbox/src/index.mts index a90d7073a..d6539d250 100644 --- a/packages/checkbox/src/index.mts +++ b/packages/checkbox/src/index.mts @@ -158,9 +158,7 @@ export default createPrompt( setShowHelpTip(false); setItems(items.map((choice, i) => (i === active ? toggle(choice) : choice))); } else if (key.name === 'a') { - const selectAll = Boolean( - items.find((choice) => isSelectable(choice) && !choice.checked), - ); + const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked); setItems(items.map(check(selectAll))); } else if (key.name === 'i') { setItems(items.map(toggle));