From 7a0223c9b3e025cc8292a45728ffab2052dfbb97 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Mon, 25 Feb 2019 12:03:12 +0200 Subject: [PATCH] fix buttons/form scrolling issue --- ui/src/components/utilities/widgets.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/components/utilities/widgets.rs b/ui/src/components/utilities/widgets.rs index c2d1556f..5cfac152 100644 --- a/ui/src/components/utilities/widgets.rs +++ b/ui/src/components/utilities/widgets.rs @@ -121,6 +121,9 @@ impl Component for FormWidget { } match event.event_type { + UIEventType::Input(Key::Up) if self.focus == FormFocus::Buttons => { + self.focus = FormFocus::Fields; + }, UIEventType::Input(Key::Up) => { self.cursor = self.cursor.saturating_sub(1); }, @@ -137,9 +140,6 @@ impl Component for FormWidget { event_type: UIEventType::ChangeMode(UIMode::Insert), }); }, - UIEventType::Input(Key::Up) if self.focus == FormFocus::Buttons => { - self.focus = FormFocus::Fields; - }, UIEventType::InsertInput(Key::Right) if self.focus == FormFocus::TextInput => { if self.cursors[self.cursor] < self.fields[&self.layout[self.cursor]].len().saturating_sub(1) { self.cursors[self.cursor] += 1;