From e671d729c4ef3e9a1cfb631064192d94c77c7a55 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 9 Oct 2022 17:46:26 +0200 Subject: Trim input when checking for emptyness --- src/gui/question.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/question.rs b/src/gui/question.rs index 8f9ee19..95f3163 100644 --- a/src/gui/question.rs +++ b/src/gui/question.rs @@ -64,7 +64,7 @@ pub fn ask( let question = Paragraph::new(util::center_vertically(chunks[1], &card.question)) .style(match state.answer { Answer::Write => { - if state.input.is_empty() { + if state.input.trim().is_empty() { Style::default().fg(Color::Yellow) } else { Style::default() -- cgit v1.2.3