Focus last entry in focus chain when going backwards from none.
@@ -351,8 +351,12 @@ impl<T: Data> Window<T> {
})
.or_else(|| {
// If the currently focused widget isn't in the focus chain,
- // then we'll just return the first entry of the chain, if any.
+ // then we'll just return the first/last entry of the chain, if any.
+ if forward {
self.focus_chain().first().copied()
+ } else {
+ self.focus_chain().last().copied()
+ }
})
})
}
