Skip to content

Commit

Permalink
Fix Shift+Tab behavior when no widget is focused
Browse files Browse the repository at this point in the history
  • Loading branch information
DataTriny committed Oct 23, 2023
1 parent fd75adb commit 9e6ea23
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/egui/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,13 @@ impl Focus {
// nothing has focus and the user pressed tab - give focus to the first widgets that wants it:
self.focused_widget = Some(FocusWidget::new(id));
self.reset_focus();
} else if self.focus_direction == FocusDirection::Previous
&& self.focused_widget.is_none()
&& !self.give_to_next
{
// nothing has focus and the user pressed Shift+Tab - give focus to the last widgets that wants it:
self.focused_widget = self.last_interested.map(FocusWidget::new);
self.reset_focus();
}

self.last_interested = Some(id);
Expand Down

0 comments on commit 9e6ea23

Please sign in to comment.