mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Merge pull request #283 from Ben-Alderson/master
Fix crash when removing the final child from LinearLayout when that child has focus
This commit is contained in:
commit
8f6b37db00
@ -192,7 +192,7 @@ impl LinearLayout {
|
|||||||
if i < self.children.len() {
|
if i < self.children.len() {
|
||||||
self.invalidate();
|
self.invalidate();
|
||||||
|
|
||||||
if self.focus > i {
|
if self.focus > i || (self.focus != 0 && self.focus == self.children.len() - 1) {
|
||||||
self.focus -= 1;
|
self.focus -= 1;
|
||||||
}
|
}
|
||||||
Some(self.children.remove(i).view)
|
Some(self.children.remove(i).view)
|
||||||
|
Loading…
Reference in New Issue
Block a user