diff --git a/src/views/linear_layout.rs b/src/views/linear_layout.rs index b6fd446..92ec4ab 100644 --- a/src/views/linear_layout.rs +++ b/src/views/linear_layout.rs @@ -181,6 +181,10 @@ impl LinearLayout { pub fn remove_child(&mut self, i: usize) -> Option> { if i < self.children.len() { self.invalidate(); + + if self.focus > i { + self.focus -= 1; + } Some(self.children.remove(i).view) } else { None