Skip to content

Commit

Permalink
don't do anything in right() if depth is 0, not down
Browse files Browse the repository at this point in the history
  • Loading branch information
micielski committed Aug 6, 2024
1 parent 79cfd0a commit dca4b8c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ impl<T: Clone> MenuState<T> {
///
/// down highlights "sub item 2"
pub fn down(&mut self) {
if self.active_depth() == 0 {
// do nothing
} else if self.active_depth() == 1 {
if self.active_depth() == 1 {
self.push();
} else {
self.next();
Expand Down Expand Up @@ -213,7 +211,9 @@ impl<T: Clone> MenuState<T> {
/// right pushes "sub sub item 2". this differs from case 2 that
/// current highlighted item can be expanded
pub fn right(&mut self) {
if self.active_depth() == 1 {
if self.active_depth() == 0 {
// do nothing
} else if self.active_depth() == 1 {
self.next();
} else if self.active_depth() == 2 {
if self.push().is_none() {
Expand Down

0 comments on commit dca4b8c

Please sign in to comment.