Skip to content

Commit dd0daf5

Browse files
committed
fix(tui): placeholder and input mutually exclusive — no overlap
1 parent e9507b5 commit dd0daf5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

crates/tui/src/app.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,16 +1054,17 @@ fn render_input_with_prompt(
10541054
height: area.height,
10551055
};
10561056

1057-
// Show placeholder only when input is completely empty
10581057
if input.is_empty() {
1058+
// Placeholder — only rendered when truly empty, mutually exclusive with input
10591059
let placeholder = Line::from(Span::styled(
10601060
"Type a message...",
10611061
Style::default().fg(Color::DarkGray),
10621062
));
10631063
Widget::render(placeholder, input_area, buf);
1064+
} else {
1065+
// Actual input content — no placeholder underneath
1066+
Widget::render(input, input_area, buf);
10641067
}
1065-
// Always render input on top (when non-empty, overwrites placeholder)
1066-
Widget::render(input, input_area, buf);
10671068
}
10681069

10691070
#[allow(clippy::cast_possible_truncation)]

0 commit comments

Comments
 (0)