From 66c5f6571eb22efce458cc6bec54a80e38de89c8 Mon Sep 17 00:00:00 2001 From: Hongxu Xu Date: Thu, 19 Nov 2020 12:52:15 +0800 Subject: [PATCH] Add a comment --- src/CalcViewModel/UnitConverterViewModel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CalcViewModel/UnitConverterViewModel.cpp b/src/CalcViewModel/UnitConverterViewModel.cpp index 808a9344..2fa989e8 100644 --- a/src/CalcViewModel/UnitConverterViewModel.cpp +++ b/src/CalcViewModel/UnitConverterViewModel.cpp @@ -505,6 +505,8 @@ void UnitConverterViewModel::OnButtonPressed(Platform::Object ^ parameter) static constexpr UCM::Command OPERANDS[] = { UCM::Command::Zero, UCM::Command::One, UCM::Command::Two, UCM::Command::Three, UCM::Command::Four, UCM::Command::Five, UCM::Command::Six, UCM::Command::Seven, UCM::Command::Eight, UCM::Command::Nine }; + + // input should be allowed if user just switches active, because we will clear values in such cases if (m_isInputBlocked && !m_model->IsSwitchedActive() && command != UCM::Command::Clear && command != UCM::Command::Backspace) { return;