Skip to content

Commit

Permalink
Focus last entry in focus chain when going backwards from none.
Browse files Browse the repository at this point in the history
  • Loading branch information
xStrom committed Apr 10, 2020
1 parent fc9825e commit 310b690
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions druid/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
self.focus_chain().first().copied()
// 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()
}
})
})
}
Expand Down

0 comments on commit 310b690

Please sign in to comment.