From 3ddcf740c692e91ede4f89ba18a3b6e8a43219c4 Mon Sep 17 00:00:00 2001 From: Julian Arevalo Date: Mon, 9 Dec 2024 13:19:39 +0100 Subject: [PATCH] Fix nano backspace key behavior Stay on backspace key until there is a PIN entry to delete --- lib_nbgl/src/nbgl_layout_keypad_nanos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_nbgl/src/nbgl_layout_keypad_nanos.c b/lib_nbgl/src/nbgl_layout_keypad_nanos.c index 877a00b3f..ecc680b88 100644 --- a/lib_nbgl/src/nbgl_layout_keypad_nanos.c +++ b/lib_nbgl/src/nbgl_layout_keypad_nanos.c @@ -136,8 +136,8 @@ int nbgl_layoutUpdateKeypad(nbgl_layout_t *layout, // if validate key is enabled and was not, select it directly keypad->selectedKey = 11; } - else { - // otherwise let the draw function pick a new selected + // Shuffle if selected key was not backspace or if the last pin entry has been deleted + else if ((keypad->selectedKey != 0) || (keypad->enableBackspace && !enableBackspace)) { keypad->selectedKey = 0xFF; } keypad->enableValidate = enableValidate;