mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-10 03:10:41 +00:00
Fix crash when removing a child from LinearLayout when final child has focus
This commit is contained in:
parent
92f919978c
commit
fe93b945fd
@ -192,7 +192,7 @@ impl LinearLayout {
|
||||
if i < self.children.len() {
|
||||
self.invalidate();
|
||||
|
||||
if self.focus > i {
|
||||
if self.focus > i || (self.focus != 0 && self.focus == self.children.len() - 1) {
|
||||
self.focus -= 1;
|
||||
}
|
||||
Some(self.children.remove(i).view)
|
||||
|
Loading…
Reference in New Issue
Block a user