fix buttons/form scrolling issue
parent
c135650018
commit
7a0223c9b3
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue