much better, still not it
This commit is contained in:
@@ -100,12 +100,15 @@ pub fn render_canvas(
|
||||
if let Some(input_rect) = active_field_input_rect {
|
||||
let selected_index = form_state.get_selected_suggestion_index();
|
||||
|
||||
// Calculate dropdown area below the active input field
|
||||
let dropdown_height = (suggestions.len() as u16).min(5) + 2; // Max 5 suggestions + border
|
||||
// --- Calculate Compact Dropdown Size ---
|
||||
let max_suggestion_width = suggestions.iter().map(|s| s.len()).max().unwrap_or(0) as u16;
|
||||
let dropdown_width = max_suggestion_width.max(10); // Use longest suggestion width, min 10
|
||||
let dropdown_height = (suggestions.len() as u16).min(5); // Height matches suggestion count, max 5
|
||||
// --- End Size Calculation ---
|
||||
let dropdown_area = Rect {
|
||||
x: input_rect.x,
|
||||
y: input_rect.y + 1, // Position below the input line
|
||||
width: input_rect.width.max(20), // Ensure minimum width
|
||||
y: input_rect.y + 1,
|
||||
width: dropdown_width,
|
||||
height: dropdown_height,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user