mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
LinearLayout: fix focus after removing child
This commit is contained in:
parent
a47537ec2c
commit
4c70b79663
@ -181,6 +181,10 @@ impl LinearLayout {
|
||||
pub fn remove_child(&mut self, i: usize) -> Option<Box<View>> {
|
||||
if i < self.children.len() {
|
||||
self.invalidate();
|
||||
|
||||
if self.focus > i {
|
||||
self.focus -= 1;
|
||||
}
|
||||
Some(self.children.remove(i).view)
|
||||
} else {
|
||||
None
|
||||
|
Loading…
Reference in New Issue
Block a user