From c92b1acb6e56c7bbe935f6c4be1ba6e9b7742729 Mon Sep 17 00:00:00 2001 From: Adrian Neumann Date: Thu, 26 Oct 2017 20:23:00 +0200 Subject: [PATCH] Ignore keys properly in SelectView::on_event on_event consumes all keypresses by trying to jump to the item that matches the char. Even if no such item is found, the key event is lost to the rest of the application. By returning EventResult::Ignored when the key press has no effect, the key event that have no effect on the SelectView can still be used by somebody else. --- src/views/select_view.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/views/select_view.rs b/src/views/select_view.rs index f9f3c3f..5fd0bfd 100644 --- a/src/views/select_view.rs +++ b/src/views/select_view.rs @@ -437,6 +437,8 @@ impl SelectView { // Apply modulo in case we have a hit // from the chained iterator self.focus.set(i % self.items.len()); + } else { + return EventResult::Ignored; } } _ => return EventResult::Ignored,