mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 21:28:48 +00:00
Fix always selecting the first item to run
This commit is contained in:
parent
c399722959
commit
5d68f49e59
|
@ -414,11 +414,6 @@ impl CustomList {
|
||||||
///
|
///
|
||||||
/// Returns `Some(command)` when command is selected, othervise we returns `None`
|
/// Returns `Some(command)` when command is selected, othervise we returns `None`
|
||||||
fn handle_enter(&mut self) -> Option<Command> {
|
fn handle_enter(&mut self) -> Option<Command> {
|
||||||
// Ensure an item is selected if none is selected
|
|
||||||
if self.list_state.selected().is_none() {
|
|
||||||
self.list_state.select(Some(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the selected index
|
// Get the selected index
|
||||||
let selected = self.list_state.selected().unwrap();
|
let selected = self.list_state.selected().unwrap();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user