Skip to content

Commit

Permalink
fixed #198
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikwilkowski committed Nov 24, 2023
1 parent 4340303 commit 070f0cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,12 @@ fn view_tree_previous(root_view: &dyn View, id: &Id) -> Option<Id> {

view_previous_sibling(root_view, id_path.dispatch())
.map(|view| view_nested_last_child(view).id())
.or_else(|| (root_view.id() != *id).then_some(id.parent().unwrap()))
.or_else(|| {
(root_view.id() != *id).then_some(
id.parent()
.unwrap_or_else(|| view_nested_last_child(root_view).id()),
)
})
}

/// Get the id of the view before this one (but with the same parent and level of nesting)
Expand Down

0 comments on commit 070f0cc

Please sign in to comment.