deprecation fixed, touple passed to set cursor position
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// src/client/components/form.rs
|
||||
|
||||
// src/client/components1/handlers/form.rs
|
||||
use ratatui::{
|
||||
widgets::{Paragraph, Block, Borders},
|
||||
layout::{Layout, Constraint, Direction, Rect, Margin, Alignment},
|
||||
@@ -124,19 +123,19 @@ pub fn render_form(
|
||||
if is_active && is_edit_mode { // Move cursor logic inside the loop
|
||||
let cursor_x = input_rows[i].x + input.len() as u16;
|
||||
let cursor_y = input_rows[i].y;
|
||||
f.set_cursor(cursor_x, cursor_y);
|
||||
f.set_cursor_position((cursor_x, cursor_y)); // Updated to set_cursor_position
|
||||
}
|
||||
if is_active {
|
||||
if is_edit_mode {
|
||||
// Edit mode: cursor at current_cursor_pos instead of end
|
||||
let cursor_x = input_rows[i].x + form_state.current_cursor_pos as u16;
|
||||
let cursor_y = input_rows[i].y;
|
||||
f.set_cursor(cursor_x, cursor_y);
|
||||
f.set_cursor_position((cursor_x, cursor_y)); // Updated to set_cursor_position
|
||||
} else {
|
||||
// Read-only mode: cursor at current_cursor_pos
|
||||
let cursor_x = input_rows[i].x + form_state.current_cursor_pos as u16;
|
||||
let cursor_y = input_rows[i].y;
|
||||
f.set_cursor(cursor_x, cursor_y);
|
||||
f.set_cursor_position((cursor_x, cursor_y)); // Updated to set_cursor_position
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user