aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoris2022-10-09 17:46:26 +0200
committerJoris2022-10-09 17:46:26 +0200
commite671d729c4ef3e9a1cfb631064192d94c77c7a55 (patch)
tree9e6475040fde7356dd27861b2bb11a2a2e8a0591 /src
parent3c935cc0728f25dab169d2a05dfa153242946c4a (diff)
downloadflashcards-e671d729c4ef3e9a1cfb631064192d94c77c7a55.tar.gz
flashcards-e671d729c4ef3e9a1cfb631064192d94c77c7a55.tar.bz2
flashcards-e671d729c4ef3e9a1cfb631064192d94c77c7a55.zip
Trim input when checking for emptyness
Diffstat (limited to 'src')
-rw-r--r--src/gui/question.rs2
1 files changed, 1 insertions, 1 deletions
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<B: Backend>(
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()