fixed more dropdown menu
This commit is contained in:
@@ -47,7 +47,7 @@ pub fn render_register(
|
|||||||
.split(inner_area);
|
.split(inner_area);
|
||||||
|
|
||||||
// --- FORM RENDERING (Using render_canvas) ---
|
// --- FORM RENDERING (Using render_canvas) ---
|
||||||
crate::components::handlers::canvas::render_canvas(
|
let active_field_rect = crate::components::handlers::canvas::render_canvas(
|
||||||
f,
|
f,
|
||||||
chunks[0], // Area for the canvas
|
chunks[0], // Area for the canvas
|
||||||
state, // The state object (RegisterState)
|
state, // The state object (RegisterState)
|
||||||
@@ -135,6 +135,16 @@ pub fn render_register(
|
|||||||
button_chunks[1],
|
button_chunks[1],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// --- Render Autocomplete Dropdown (Draw AFTER buttons) ---
|
||||||
|
if let Some(suggestions) = state.get_suggestions() {
|
||||||
|
let selected = state.get_selected_suggestion_index();
|
||||||
|
if !suggestions.is_empty() {
|
||||||
|
if let Some(input_rect) = active_field_rect {
|
||||||
|
autocomplete::render_autocomplete_dropdown(f, input_rect, f.size(), theme, suggestions, selected);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// --- DIALOG --- (Keep dialog logic)
|
// --- DIALOG --- (Keep dialog logic)
|
||||||
if app_state.ui.dialog.dialog_show {
|
if app_state.ui.dialog.dialog_show {
|
||||||
dialog::render_dialog(
|
dialog::render_dialog(
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ pub fn render_canvas(
|
|||||||
inputs: &[&String],
|
inputs: &[&String],
|
||||||
theme: &Theme,
|
theme: &Theme,
|
||||||
is_edit_mode: bool,
|
is_edit_mode: bool,
|
||||||
) {
|
) -> Option<Rect> {
|
||||||
// Split area into columns
|
// Split area into columns
|
||||||
let columns = Layout::default()
|
let columns = Layout::default()
|
||||||
.direction(Direction::Horizontal)
|
.direction(Direction::Horizontal)
|
||||||
@@ -95,13 +95,5 @@ pub fn render_canvas(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Render Autocomplete Dropdown (if applicable) ---
|
active_field_input_rect
|
||||||
if let Some(suggestions) = form_state.get_suggestions() {
|
|
||||||
let selected = form_state.get_selected_suggestion_index();
|
|
||||||
if !suggestions.is_empty() {
|
|
||||||
if let Some(input_rect) = active_field_input_rect {
|
|
||||||
autocomplete::render_autocomplete_dropdown(f, input_rect, f.size(), theme, suggestions, selected);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user