working suggestions but position is wrong
This commit is contained in:
@@ -81,16 +81,12 @@ impl RegisterState {
|
||||
/// Updates role suggestions based on current input.
|
||||
pub fn update_role_suggestions(&mut self) {
|
||||
let current_input = self.role.to_lowercase();
|
||||
if current_input.is_empty() {
|
||||
self.role_suggestions = AVAILABLE_ROLES.to_vec();
|
||||
} else {
|
||||
self.role_suggestions = AVAILABLE_ROLES
|
||||
.iter()
|
||||
.filter(|r| r.to_lowercase().starts_with(¤t_input))
|
||||
.cloned()
|
||||
.collect();
|
||||
self.show_role_suggestions = !self.role_suggestions.is_empty();
|
||||
}
|
||||
self.role_suggestions = AVAILABLE_ROLES
|
||||
.iter()
|
||||
.filter(|role| role.to_lowercase().contains(¤t_input))
|
||||
.cloned()
|
||||
.collect();
|
||||
self.show_role_suggestions = !self.role_suggestions.is_empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user