mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 21:28:48 +00:00
Simplified placeholder text logic
Co-authored-by: Andrii Dokhniak <adokhniak@gmail.com>
This commit is contained in:
parent
9e1cd25603
commit
5cddfdb162
|
@ -36,12 +36,8 @@ impl SearchBar {
|
|||
|
||||
pub fn draw(&self, frame: &mut Frame, area: Rect, state: &AppState) {
|
||||
//Set the search bar text (If empty use the placeholder)
|
||||
let display_text = if self.search_input.is_empty() {
|
||||
if self.in_search_mode {
|
||||
Span::raw("")
|
||||
} else {
|
||||
Span::raw("Press / to search")
|
||||
}
|
||||
let display_text = if !self.in_search_mode && self.search_input.is_empty() {
|
||||
Span::raw("Press / to search")
|
||||
} else {
|
||||
Span::raw(&self.search_input)
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user