From 8d1ca31d8c4007d322dff3da639d28777a7b645c Mon Sep 17 00:00:00 2001 From: Jared Allard Date: Fri, 25 Oct 2024 11:33:17 -0700 Subject: [PATCH] fix(accessibility): parseBool defaults to no Matching the prompt of "Choose [y/N]:" default is now equal to N. Resolves https://github.com/charmbracelet/huh/issues/264 --- accessibility/accessibility.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accessibility/accessibility.go b/accessibility/accessibility.go index 60accc1f..5ada18d6 100644 --- a/accessibility/accessibility.go +++ b/accessibility/accessibility.go @@ -42,7 +42,9 @@ func parseBool(s string) (bool, error) { } } - for _, n := range []string{"n", "no"} { + // As a special case, we default to "" to no since the usage of this + // function suggests N is the default. + for _, n := range []string{"", "n", "no"} { if n == s { return false, nil }