login is not dependent on form/form.rs and only on canvas now
This commit is contained in:
@@ -10,18 +10,18 @@ pub async fn handle_action(
|
||||
match action {
|
||||
"move_up" => {
|
||||
if auth_state.return_selected {
|
||||
// Coming from return button to fields
|
||||
// From Return button to last field (password)
|
||||
auth_state.return_selected = false;
|
||||
auth_state.current_field = 1; // Focus on password field
|
||||
auth_state.current_field = 1;
|
||||
} else if auth_state.current_field == 1 {
|
||||
// Moving from password to username/email
|
||||
// Password -> Username
|
||||
auth_state.current_field = 0;
|
||||
} else if auth_state.current_field == 0 {
|
||||
// Wrap around to buttons
|
||||
auth_state.return_selected = false; // Select Login button
|
||||
// Username -> Password (wrap around fields only)
|
||||
auth_state.current_field = 1;
|
||||
}
|
||||
|
||||
// Update cursor position when in a field
|
||||
// Update cursor position
|
||||
if !auth_state.return_selected {
|
||||
let current_input = auth_state.get_current_input();
|
||||
let max_cursor_pos = current_input.len();
|
||||
@@ -29,18 +29,18 @@ pub async fn handle_action(
|
||||
}
|
||||
|
||||
Ok(format!("Navigation 'up' from functions/login"))
|
||||
},
|
||||
}
|
||||
"move_down" => {
|
||||
if auth_state.return_selected {
|
||||
// Coming from return button to fields
|
||||
// From Return button to first field (username)
|
||||
auth_state.return_selected = false;
|
||||
auth_state.current_field = 0; // Focus on username field
|
||||
auth_state.current_field = 0;
|
||||
} else if auth_state.current_field == 0 {
|
||||
// Moving from username/email to password
|
||||
// Username -> Password
|
||||
auth_state.current_field = 1;
|
||||
} else if auth_state.current_field == 1 {
|
||||
// Moving from password to buttons
|
||||
auth_state.return_selected = false; // Select Login button
|
||||
// Password -> Buttons (Login button)
|
||||
auth_state.return_selected = false;
|
||||
}
|
||||
|
||||
// Update cursor position when in a field
|
||||
@@ -51,7 +51,7 @@ pub async fn handle_action(
|
||||
}
|
||||
|
||||
Ok(format!("Navigation 'down' from functions/login"))
|
||||
},
|
||||
}
|
||||
_ => Err("Unknown login action".into())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user