working read only mode in login and register properly workig now

This commit is contained in:
filipriec
2025-04-11 08:50:54 +02:00
parent 14f9b254b2
commit eff46ac9bf
3 changed files with 63 additions and 13 deletions

View File

@@ -243,8 +243,17 @@ pub async fn run_ui() -> Result<(), Box<dyn std::error::Error>> {
form_state.current_cursor_pos =
event_handler.ideal_cursor_column.min(max_cursor_pos);
}
} else if app_state.ui.show_login || app_state.ui.show_register {
// Handle cursor updates for AuthState if needed, similar to FormState
} else if app_state.ui.show_register {
if !event_handler.is_edit_mode {
let current_input = register_state.get_current_input();
let max_cursor_pos = if !current_input.is_empty() {
current_input.len() - 1
} else {
0
};
register_state.current_cursor_pos = event_handler.ideal_cursor_column.min(max_cursor_pos);
}
} else if app_state.ui.show_login {
if !event_handler.is_edit_mode {
let current_input = auth_state.get_current_input();
let max_cursor_pos = if !current_input.is_empty() {